mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-13 15:37:58 +08:00
12 lines
481 B
Plaintext
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'}
|
|
|