mirror of
https://github.com/dagucloud/dagu.git
synced 2026-12-05 21:34:48 +00:00
15 lines
255 B
Go
15 lines
255 B
Go
package utils
|
|
|
|
import (
|
|
"regexp"
|
|
"testing"
|
|
)
|
|
|
|
func AssertPattern(t *testing.T, name string, want string, actual string) {
|
|
re := regexp.MustCompile(want)
|
|
|
|
if !re.Match([]byte(actual)) {
|
|
t.Fatalf("%s should match %s, was %s", name, want, actual)
|
|
}
|
|
}
|