mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-31 03:40:08 +00:00
Remove printing facilities for Regular_Expression
The `original_pattern` introduced a tenuous dependency to the expression value as a whole, and after some consideration, I decided that it would be better for the developer to manage their own pattern strings. In the event you need to print the text representation of a pattern, it's usually better that you manage the memory of it as well.
This commit is contained in:
@@ -681,28 +681,6 @@ test_optional_inside_optional :: proc(t: ^testing.T) {
|
||||
check_expression(t, EXPR, "", "")
|
||||
}
|
||||
|
||||
@test
|
||||
test_printing :: proc(t: ^testing.T) {
|
||||
rex, err := regex.create(`^/a$`, {
|
||||
.Global,
|
||||
.Multiline,
|
||||
.Case_Insensitive,
|
||||
.Unicode,
|
||||
.Ignore_Whitespace,
|
||||
.No_Optimization,
|
||||
.No_Capture,
|
||||
})
|
||||
if !testing.expect_value(t, err, nil) {
|
||||
return
|
||||
}
|
||||
defer regex.destroy(rex)
|
||||
|
||||
str := fmt.tprint(rex)
|
||||
str_hash := fmt.tprintf("%#v", rex)
|
||||
testing.expect_value(t, str, `/^\/a$/gmixun-`)
|
||||
testing.expect_value(t, str_hash, `/^\/a$/gmixun-`)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@test
|
||||
|
||||
Reference in New Issue
Block a user