1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 06:50:05 +08:00
SpaceVim/test/lua/data/string.vader
2022-10-16 13:45:34 +08:00

11 lines
390 B
Plaintext

Execute ( SpaceVim lua api: data#string ):
if !has('nvim-0.5.0')
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]]