feat(json2go): implement

This commit is contained in:
Oleksandr Smirnov 2025-11-28 16:35:52 +02:00
parent 4a2384ade8
commit 72dd68f25f
No known key found for this signature in database
7 changed files with 141 additions and 1 deletions

View file

@ -0,0 +1,2 @@
package main

View file

@ -0,0 +1,5 @@
package main
type AutoGenerated struct {
Json bool `json:"json"`
}

View 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