mirror of
https://github.com/TwiN/gatus.git
synced 2025-08-24 05:05:28 +02:00
Fix issue with backslashes when using pattern function
This commit is contained in:
21
pattern/pattern_bench_test.go
Normal file
21
pattern/pattern_bench_test.go
Normal 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()
|
||||
}
|
Reference in New Issue
Block a user