also looking at this
Port to latest zig-master
#2
53 files
+1149
-1017
| @@ -3,7 +3,7 @@ const Regex = @import("regex").Regex; | ||
| 3 | 3 | |
| 4 | 4 | test "string anchor: \\A start of text" { |
| 5 | 5 | const allocator = std.testing.allocator; |
| 6 | var regex = try Regex.compile(allocator, "\\Aabc"); | |
| 6 | var regex = try Regex.compile(allocator, std.testing.io, "\\Aabc"); | |
| 7 | 7 | defer regex.deinit(); |
| 8 | 8 | |
| 9 | 9 | // Should match at the start of the text |
| @@ -17,7 +17,7 @@ test "string anchor: \\A start of text" { | ||
| 17 | 17 | |
| 18 | 18 | test "string anchor: \\z end of text" { |
| 19 | 19 | 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"); | |
| 21 | 21 | defer regex.deinit(); |
| 22 | 22 | |
| 23 | 23 | // Should match at the end of the text |
| @@ -30,7 +30,7 @@ test "string anchor: \\z end of text" { | ||
| 30 | 30 | |
| 31 | 31 | test "string anchor: \\Z end of text (before optional newline)" { |
| 32 | 32 | 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"); | |
| 34 | 34 | defer regex.deinit(); |
| 35 | 35 | |
| 36 | 36 | // Should match at the end of the text |
| @@ -45,10 +45,10 @@ test "string anchor: \\Z end of text (before optional newline)" { | ||
| 45 | 45 | test "string anchors: \\A vs ^" { |
| 46 | 46 | const allocator = std.testing.allocator; |
| 47 | 47 | |
| 48 | var regex_A = try Regex.compile(allocator, "\\Atest"); | |
| 48 | var regex_A = try Regex.compile(allocator, std.testing.io, "\\Atest"); | |
| 49 | 49 | defer regex_A.deinit(); |
| 50 | 50 | |
| 51 | var regex_caret = try Regex.compile(allocator, "^test"); | |
| 51 | var regex_caret = try Regex.compile(allocator, std.testing.io, "^test"); | |
| 52 | 52 | defer regex_caret.deinit(); |
| 53 | 53 | |
| 54 | 54 | const input1 = "test"; |
| @@ -68,7 +68,7 @@ test "string anchors: \\A vs ^" { | ||
| 68 | 68 | |
| 69 | 69 | test "string anchors: combined \\A and \\z" { |
| 70 | 70 | 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"); | |
| 72 | 72 | defer regex.deinit(); |
| 73 | 73 | |
| 74 | 74 | // Should match only exact strings |