Fix issue with backslashes when using pattern function

This commit is contained in:
TwinProduction committed 2021-01-04 18:01:39 -05:00
1 parent f1c0bbe73c
commit c27cb7af08
3 files changed
+45 -11

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
package pattern
import "testing"
func BenchmarkMatch(b *testing.B) {
for n := 0; n < b.N; n++ {
if !Match("*ing*", "livingroom") {
b.Error("should've matched")
}
}
b.ReportAllocs()
}
func BenchmarkMatchWithBackslash(b *testing.B) {
for n := 0; n < b.N; n++ {
if !Match("*ing*", "living\\room") {
b.Error("should've matched")
}
}
b.ReportAllocs()
}