1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/template.matches.go
Tibor Vass 6abf32fd52
add rm-gocheck.go script and eg templates
The following "rm-gocheck:"-prefixed commits were generated by
go run rm-gocheck.go --commit

Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 8f64611c83)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:13 +02:00

37 lines
717 B
Go

// +build ignore
package main
import (
"testing"
"gotest.tools/assert"
"gotest.tools/assert/cmp"
)
type fn func(re func(cmp.RegexOrPattern, string) cmp.Comparison, r interface{}, v string, extra ...interface{}) bool
type assertfn func(t assert.TestingT, comparison assert.BoolOrComparison, msgAndArgs ...interface{})
func before(
t *testing.T,
a assertfn,
eg_matches fn,
re func(cmp.RegexOrPattern, string) cmp.Comparison,
r string,
v string,
extra ...interface{}) {
a(t, eg_matches(re, v, r, extra...))
}
func after(
t *testing.T,
a assertfn,
eg_matches fn,
re func(cmp.RegexOrPattern, string) cmp.Comparison,
r string,
v string,
extra ...interface{}) {
a(t, re("^"+r+"$", v), extra...)
}