dev (#1)
* dev * Improve sync design * Support buffer local mapping * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * stylua * tmp * tmp * tmp * tmp * tmp * tmp * tmp * integration * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * update * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp * tmp
This commit is contained in:
26
lua/cmp/utils/str_spec.lua
Normal file
26
lua/cmp/utils/str_spec.lua
Normal file
@@ -0,0 +1,26 @@
|
||||
local str = require "cmp.utils.str"
|
||||
|
||||
describe('utils.str', function()
|
||||
|
||||
it('get_word', function()
|
||||
assert.are.equal(str.get_word('print'), 'print')
|
||||
assert.are.equal(str.get_word('$variable'), '$variable')
|
||||
assert.are.equal(str.get_word('print()'), 'print')
|
||||
assert.are.equal(str.get_word('["cmp#confirm"]'), '["cmp#confirm"]')
|
||||
assert.are.equal(str.get_word('"devDependencies":', string.byte('"')), '"devDependencies')
|
||||
end)
|
||||
|
||||
it('strikethrough', function()
|
||||
assert.are.equal(str.strikethrough('あいうえお'), 'あ̶い̶う̶え̶お̶')
|
||||
end)
|
||||
|
||||
it('remove_suffix', function()
|
||||
assert.are.equal(str.remove_suffix('log()', '$0'), 'log()')
|
||||
assert.are.equal(str.remove_suffix('log()$0', '$0'), 'log()')
|
||||
assert.are.equal(str.remove_suffix('log()${0}', '${0}'), 'log()')
|
||||
assert.are.equal(str.remove_suffix('log()${0:placeholder}', '${0}'), 'log()${0:placeholder}')
|
||||
end)
|
||||
|
||||
end)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user