even more feedback

This commit is contained in:
Guillaume Ballet 2019-11-22 16:58:34 +01:00
parent 73e9340365
commit a1defe5e60

View file

@ -140,17 +140,6 @@ func (tm *testMatcher) whitelist(pattern string) {
tm.whitelistpat = regexp.MustCompile(pattern) tm.whitelistpat = regexp.MustCompile(pattern)
} }
func TestWhitelist(t *testing.T) {
t.Parallel()
tm := new(testMatcher)
tm.whitelist("invalid*")
tm.walk(t, rlpTestDir, func(t *testing.T, name string, test *RLPTest) {
if name[:len("invalidRLPTest.json")] != "invalidRLPTest.json" {
t.Fatalf("invalid test found: %s != invalidRLPTest.json", name)
}
})
}
// config defines chain config for tests matching the pattern. // config defines chain config for tests matching the pattern.
func (tm *testMatcher) config(pattern string, cfg params.ChainConfig) { func (tm *testMatcher) config(pattern string, cfg params.ChainConfig) {
tm.configpat = append(tm.configpat, testConfig{regexp.MustCompile(pattern), cfg}) tm.configpat = append(tm.configpat, testConfig{regexp.MustCompile(pattern), cfg})
@ -300,3 +289,14 @@ func runTestFunc(runTest interface{}, t *testing.T, name string, m reflect.Value
m.MapIndex(reflect.ValueOf(key)), m.MapIndex(reflect.ValueOf(key)),
}) })
} }
func TestMatcherWhitelist(t *testing.T) {
t.Parallel()
tm := new(testMatcher)
tm.whitelist("invalid*")
tm.walk(t, rlpTestDir, func(t *testing.T, name string, test *RLPTest) {
if name[:len("invalidRLPTest.json")] != "invalidRLPTest.json" {
t.Fatalf("invalid test found: %s != invalidRLPTest.json", name)
}
})
}