Skip to content

Conversation

@twio142
Copy link
Contributor

@twio142 twio142 commented Nov 30, 2025

The "contains" filter would previously fail when searching for a string containing a hyphen (e.g., "repo-name").

This is fixed by using a literal substring search, ignoring Lua pattern characters.

@moyiz
Copy link
Owner

moyiz commented Dec 6, 2025

Nice catch, thanks.
Please apply this patch to add a test case:

diff --git i/tests/session_spec.lua w/tests/session_spec.lua
index 26772c0..48646f0 100644
--- i/tests/session_spec.lua
+++ w/tests/session_spec.lua
@@ -16,6 +16,10 @@ local function gen_repos()
       foo = "gas",
       foo2 = "gas2",
     },
+    {
+      foo = "test-hyphen",
+      foo2 = "test-hyphen2",
+    },
   }
   for i, repo in ipairs(repos) do
     repo.repo_dir = i
@@ -37,6 +41,8 @@ local filters_to_nr = {
     },
     1,
   },
+
+  { { { name = "foo", value = "test-h", type = "contains" } }, 1 },
 }
 
 local function test_sanity()

The "contains" filter would previously fail when searching for a
string containing a hyphen (e.g., "repo-name").

This is fixed by using a literal substring search, ignoring Lua
pattern characters.
@moyiz moyiz merged commit 3d86b12 into moyiz:master Dec 6, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants