Skip to content

Commit dbce561

Browse files
committed
restore more tests from rebase
1 parent 2cde93a commit dbce561

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

tests/tags_spec.lua

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ describe("tags.find_mentions", function()
4343
it("finds simple filenames", function()
4444
assert.are.same({ "foo.c" }, tags.find_mentions("take methods in @foo.c"))
4545
end)
46+
47+
it("ignores trailing sentence punctuation", function()
48+
assert.are.same({ "foo.lua" }, tags.find_mentions("update @foo.lua."))
49+
end)
50+
51+
it("ignores trailing slashes", function()
52+
assert.are.same({ "lua/jumpy" }, tags.find_mentions("look at @lua/jumpy/"))
53+
end)
4654
end)
4755

4856
describe("tags.strip_mentions", function()
@@ -52,6 +60,14 @@ describe("tags.strip_mentions", function()
5260
tags.strip_mentions("move helpers from @lua/jumpy/foo.lua into this file")
5361
)
5462
end)
63+
64+
it("removes mentions followed by sentence punctuation", function()
65+
assert.are.equal("update .", tags.strip_mentions("update @foo.lua."))
66+
end)
67+
68+
it("removes mentions followed by trailing slashes", function()
69+
assert.are.equal("look at", tags.strip_mentions("look at @lua/jumpy/"))
70+
end)
5571
end)
5672

5773
describe("tags.truncate_lines", function()

0 commit comments

Comments
 (0)