1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-24 06:30:03 +08:00
SpaceVim/test/lua/api/data/json.vader
2021-08-15 19:06:48 +08:00

10 lines
466 B
Plaintext

Execute ( SpaceVim lua api: data.json ):
if get(g:, 'spacevim_use_lua', 0)
let cmp = SpaceVim#api#import('vim#compatible')
lua spacevim_json = require('spacevim.api').import('data.json')
lua context = '{"java" : "hello world"}'
AssertEqual cmp.luaeval('spacevim_json.json_decode(context).java'), 'hello world'
AssertEqual cmp.luaeval("spacevim_json.json_decode(spacevim_json.json_encode({['foo'] = 'zaa'}))"), {'foo' : 'zaa'}
endif