mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-03 07:00:05 +08:00
12 lines
415 B
Plaintext
12 lines
415 B
Plaintext
Execute ( SpaceVim lua api: data#string ):
|
|
if !has('nvim-0.7.2')
|
|
Log 'skip lua test'
|
|
finish
|
|
endif
|
|
let cmp = SpaceVim#api#import('vim#compatible')
|
|
Log 'test trim()'
|
|
lua sp_str = require('spacevim.api').import('data.string')
|
|
AssertEqual cmp.luaeval("sp_str.trim(' s b ')"), 's b'
|
|
AssertEqual cmp.luaeval("sp_str.strAllIndex('hello spacevim hello', 'hello', 0)"), [[0, 5], [15, 20]]
|
|
|