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/string_anchors.zigmodified+6-6
Changes to tests/string_anchors.zig
@@ -3,7 +3,7 @@ const Regex = @import("regex").Regex;
33
44test "string anchor: \\A start of text" {
55 const allocator = std.testing.allocator;
6 var regex = try Regex.compile(allocator, "\\Aabc");
6 var regex = try Regex.compile(allocator, std.testing.io, "\\Aabc");
77 defer regex.deinit();
88
99 // Should match at the start of the text
@@ -17,7 +17,7 @@ test "string anchor: \\A start of text" {
1717
1818test "string anchor: \\z end of text" {
1919 const allocator = std.testing.allocator;
20 var regex = try Regex.compile(allocator, "abc\\z");
20 var regex = try Regex.compile(allocator, std.testing.io, "abc\\z");
2121 defer regex.deinit();
2222
2323 // Should match at the end of the text
@@ -30,7 +30,7 @@ test "string anchor: \\z end of text" {
3030
3131test "string anchor: \\Z end of text (before optional newline)" {
3232 const allocator = std.testing.allocator;
33 var regex = try Regex.compile(allocator, "abc\\Z");
33 var regex = try Regex.compile(allocator, std.testing.io, "abc\\Z");
3434 defer regex.deinit();
3535
3636 // Should match at the end of the text
@@ -45,10 +45,10 @@ test "string anchor: \\Z end of text (before optional newline)" {
4545test "string anchors: \\A vs ^" {
4646 const allocator = std.testing.allocator;
4747
48 var regex_A = try Regex.compile(allocator, "\\Atest");
48 var regex_A = try Regex.compile(allocator, std.testing.io, "\\Atest");
4949 defer regex_A.deinit();
5050
51 var regex_caret = try Regex.compile(allocator, "^test");
51 var regex_caret = try Regex.compile(allocator, std.testing.io, "^test");
5252 defer regex_caret.deinit();
5353
5454 const input1 = "test";
@@ -68,7 +68,7 @@ test "string anchors: \\A vs ^" {
6868
6969test "string anchors: combined \\A and \\z" {
7070 const allocator = std.testing.allocator;
71 var regex = try Regex.compile(allocator, "\\Aexact\\z");
71 var regex = try Regex.compile(allocator, std.testing.io, "\\Aexact\\z");
7272 defer regex.deinit();
7373
7474 // Should match only exact strings