Files
dagu/internal/utils/assert.go
T
2022-04-23 01:14:00 +09:00

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)
}
}