1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 11:50:05 +08:00
SpaceVim/test/lua/data/string.vader

12 lines
415 B
Plaintext
Raw Normal View History

2022-02-03 23:10:41 +08:00
Execute ( SpaceVim lua api: data#string ):
2024-03-22 20:15:00 +08:00
if !has('nvim-0.7.2')
Log 'skip lua test'
2022-02-03 23:10:41 +08:00
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]]
2022-02-03 23:10:41 +08:00