Skip to content

Commit 619b9e4

Browse files
author
neo451
committed
fix: commit tests
1 parent 132c10e commit 619b9e4

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tests/lsp/test_completion_util.lua

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
local eq = MiniTest.expect.equality
2+
local h = dofile "tests/helpers.lua"
3+
local M = require "obsidian.lsp.handlers._completion"
4+
5+
local T, child = h.child_vault()
6+
7+
T["get_cmp_type"] = function()
8+
-- 012345678
9+
-- |||||||||
10+
local t, prefix, ref_start = M.get_cmp_type("hello [[worl", 10)
11+
12+
eq(t, 1) -- wiki
13+
eq(prefix, "worl")
14+
eq(ref_start, 6)
15+
16+
-- 1 2 3456
17+
-- | | ||||
18+
t, prefix, ref_start = M.get_cmp_type "你好 [[worl"
19+
20+
eq(t, 1) -- wiki
21+
eq(prefix, "worl")
22+
eq(ref_start, 4)
23+
end
24+
25+
return T

0 commit comments

Comments
 (0)