mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-14 05:48:00 +08:00
10 lines
468 B
Plaintext
10 lines
468 B
Plaintext
Execute ( SpaceVim lua api: data.json ):
|
|
if has('nvim-0.5.0') || has('+lua')
|
|
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
|
|
|