mirror of
https://github.com/TwiN/gatus.git
synced 2024-11-21 15:33:17 +01:00
22 lines
371 B
Go
22 lines
371 B
Go
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()
|
|
}
|