1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-14 00:07:57 +08:00
SpaceVim/test/lua/api/data/json.vader
2024-03-22 20:15:00 +08:00

12 lines
481 B
Plaintext

Execute ( SpaceVim lua api: data.json ):
if !has('nvim-0.7.2')
Log 'skip lua test'
finish
endif
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'}