mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-03 12:30:05 +08:00
10 lines
466 B
Plaintext
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
|
||
|
|