mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-07 04:23:41 +00:00
testing: import new version of match.go
This commit is contained in:
committed by
Damian Gryski
parent
50d681359d
commit
ee81c31884
+12
-1
@@ -499,7 +499,7 @@ func (m *M) Run() (code int) {
|
||||
func runTests(matchString func(pat, str string) (bool, error), tests []InternalTest) (ran, ok bool) {
|
||||
ok = true
|
||||
|
||||
ctx := newTestContext(newMatcher(matchString, flagRunRegexp, "-test.run"))
|
||||
ctx := newTestContext(newMatcher(matchString, flagRunRegexp, "-test.run", ""))
|
||||
t := &T{
|
||||
common: common{
|
||||
output: &logger{logToStdout: flagVerbose},
|
||||
@@ -567,3 +567,14 @@ func MainStart(deps interface{}, tests []InternalTest, benchmarks []InternalBenc
|
||||
deps: deps.(testDeps),
|
||||
}
|
||||
}
|
||||
|
||||
// A fake regexp matcher.
|
||||
// Inflexible, but saves 50KB of flash and 50KB of RAM per -size full,
|
||||
// and lets tests pass on cortex-m.
|
||||
func fakeMatchString(pat, str string) (bool, error) {
|
||||
if pat == ".*" {
|
||||
return true, nil
|
||||
}
|
||||
matched := strings.Contains(str, pat)
|
||||
return matched, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user