Commit 90e8af98eb

Alex Rønne Petersen <alex@alexrp.com>
2024-11-28 15:11:18
test: Fix incorrect interpretation of -Dtest-filter=... for test-debugger.
1 parent 16b331f
Changed files (1)
test
test/src/Debugger.zig
@@ -2442,8 +2442,10 @@ fn addTest(
     db_argv2: []const []const u8,
     expected_output: []const []const u8,
 ) void {
-    for (db.options.test_filters) |test_filter| {
-        if (std.mem.indexOf(u8, name, test_filter)) |_| return;
+    if (db.options.test_filters.len > 0) {
+        for (db.options.test_filters) |test_filter| {
+            if (std.mem.indexOf(u8, name, test_filter) != null) break;
+        } else return;
     }
     if (db.options.test_target_filters.len > 0) {
         const triple_txt = target.resolved.result.zigTriple(db.b.allocator) catch @panic("OOM");