feat(json2go): implement
This commit is contained in:
parent
4a2384ade8
commit
72dd68f25f
7 changed files with 141 additions and 1 deletions
2
spec/fixtures/json2go/interativly_input.go
vendored
Normal file
2
spec/fixtures/json2go/interativly_input.go
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
package main
|
||||
|
||||
5
spec/fixtures/json2go/interativly_output.go
vendored
Normal file
5
spec/fixtures/json2go/interativly_output.go
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
package main
|
||||
|
||||
type AutoGenerated struct {
|
||||
Json bool `json:"json"`
|
||||
}
|
||||
19
spec/integration/json2go_test.lua
Normal file
19
spec/integration/json2go_test.lua
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
local t = require "spec.testutils"
|
||||
local child, T, json2go = t.setup "json2go"
|
||||
|
||||
json2go["should convert interativly"] = function()
|
||||
local rs = t.setup_test("json2go/interativly", child, { 2, 0 })
|
||||
child.cmd "GoJson"
|
||||
child.type_keys [[{"json": true}]]
|
||||
child.type_keys "<Esc>"
|
||||
child.cmd "wq" -- quit prompt
|
||||
child.cmd "write" -- the fixture file
|
||||
|
||||
t.eq(t.readfile(rs.tmp), rs.fixtures.output)
|
||||
t.cleanup(rs)
|
||||
end
|
||||
|
||||
json2go["should convert argument"] = function()
|
||||
end
|
||||
|
||||
return T
|
||||
Loading…
Add table
Add a link
Reference in a new issue