Skip to content

Commit

Permalink
test: getting the search strings works with nonmatching input at end
Browse files Browse the repository at this point in the history
  • Loading branch information
mikavilpas committed Nov 7, 2024
1 parent 81cc172 commit 7314e9a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions spec/blink-ripgrep/get_prefix_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,21 @@ describe("match_prefix", function()
end
)

it("matches when there is nonmatching input at the end", function()
assert.are_same(blink_ripgrep.match_prefix(".hello)"), "hello")
assert.are_same(blink_ripgrep.match_prefix(",hello)"), "hello")
assert.are_same(
blink_ripgrep.match_prefix(".,,!@!@$@%<<@$<hello)"),
"hello"
)
assert.are_same(blink_ripgrep.match_prefix(" hello)"), "hello")
assert.are_same(blink_ripgrep.match_prefix("random_text hello)"), "hello")
assert.are_same(blink_ripgrep.match_prefix("-- hello)"), "hello")
assert.are_same(blink_ripgrep.match_prefix("-- abc123)"), "abc123")
assert.are_same(blink_ripgrep.match_prefix("-- abc-123)"), "abc-123")
assert.are_same(blink_ripgrep.match_prefix("-- abc_123)"), "abc_123")
end)

it(
"matches when there are multiple nonmatching pieces of input in the beginning",
function()
Expand Down

0 comments on commit 7314e9a

Please sign in to comment.