ReviewOS

also looking at this

zig-utils/zig-regex

Port to latest zig-master

#2
Closed armagidon-exception wants to merge main into main
53 files +1149 -1017
tests/iterator.zigmodified+9-9
Changes to tests/iterator.zig
@@ -5,7 +5,7 @@ const Regex = @import("regex").Regex;
55
66test "iterator: basic iteration" {
77 const allocator = std.testing.allocator;
8 var regex = try Regex.compile(allocator, "\\d+");
8 var regex = try Regex.compile(allocator, std.testing.io, "\\d+");
99 defer regex.deinit();
1010
1111 const text = "123 abc 456 def 789";
@@ -29,7 +29,7 @@ test "iterator: basic iteration" {
2929
3030test "iterator: empty input" {
3131 const allocator = std.testing.allocator;
32 var regex = try Regex.compile(allocator, "\\d+");
32 var regex = try Regex.compile(allocator, std.testing.io, "\\d+");
3333 defer regex.deinit();
3434
3535 const text = "";
@@ -41,7 +41,7 @@ test "iterator: empty input" {
4141
4242test "iterator: no matches" {
4343 const allocator = std.testing.allocator;
44 var regex = try Regex.compile(allocator, "\\d+");
44 var regex = try Regex.compile(allocator, std.testing.io, "\\d+");
4545 defer regex.deinit();
4646
4747 const text = "abc def";
@@ -53,7 +53,7 @@ test "iterator: no matches" {
5353
5454test "iterator: reset functionality" {
5555 const allocator = std.testing.allocator;
56 var regex = try Regex.compile(allocator, "\\w+");
56 var regex = try Regex.compile(allocator, std.testing.io, "\\w+");
5757 defer regex.deinit();
5858
5959 const text = "hello world";
@@ -72,7 +72,7 @@ test "iterator: reset functionality" {
7272
7373test "iterator: captures in iteration" {
7474 const allocator = std.testing.allocator;
75 var regex = try Regex.compile(allocator, "(\\w+)@(\\w+)");
75 var regex = try Regex.compile(allocator, std.testing.io, "(\\w+)@(\\w+)");
7676 defer regex.deinit();
7777
7878 const text = "user@example and admin@test";
@@ -94,7 +94,7 @@ test "iterator: captures in iteration" {
9494
9595test "iterator: large input streaming" {
9696 const allocator = std.testing.allocator;
97 var regex = try Regex.compile(allocator, "\\d+");
97 var regex = try Regex.compile(allocator, std.testing.io, "\\d+");
9898 defer regex.deinit();
9999
100100 // Simulate processing large input without loading all matches
@@ -115,7 +115,7 @@ test "iterator: large input streaming" {
115115
116116test "iterator: manual loop pattern" {
117117 const allocator = std.testing.allocator;
118 var regex = try Regex.compile(allocator, "[a-z]+");
118 var regex = try Regex.compile(allocator, std.testing.io, "[a-z]+");
119119 defer regex.deinit();
120120
121121 const text = "hello world test";
@@ -146,7 +146,7 @@ test "iterator: manual loop pattern" {
146146
147147test "iterator: memory efficiency" {
148148 const allocator = std.testing.allocator;
149 var regex = try Regex.compile(allocator, "\\w+");
149 var regex = try Regex.compile(allocator, std.testing.io, "\\w+");
150150 defer regex.deinit();
151151
152152 // Iterator should not allocate all matches at once
@@ -171,7 +171,7 @@ test "iterator: memory efficiency" {
171171
172172test "iterator: overlapping matches prevention" {
173173 const allocator = std.testing.allocator;
174 var regex = try Regex.compile(allocator, "\\w\\w");
174 var regex = try Regex.compile(allocator, std.testing.io, "\\w\\w");
175175 defer regex.deinit();
176176
177177 const text = "abcd";