diff options
author | Ayke van Laethem <[email protected]> | 2023-07-26 13:23:44 +0200 |
---|---|---|
committer | Ron Evans <[email protected]> | 2023-08-04 11:59:11 +0200 |
commit | c25dd0a972a1d68b4d154831a6d196e28f17ddad (patch) | |
tree | 36bc4887c25c8a84cb525c64f3d4315b742ebd77 /testdata | |
parent | 215dd3f0be095b05dcff7b718ff1ff42e8c1e026 (diff) | |
download | tinygo-c25dd0a972a1d68b4d154831a6d196e28f17ddad.tar.gz tinygo-c25dd0a972a1d68b4d154831a6d196e28f17ddad.zip |
testing: add Testing function
This is new in Go 1.21.
Diffstat (limited to 'testdata')
-rw-r--r-- | testdata/testing.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/testdata/testing.go b/testdata/testing.go index 4c1cf44ef..ff378fea9 100644 --- a/testdata/testing.go +++ b/testdata/testing.go @@ -73,6 +73,9 @@ func fakeMatchString(pat, str string) (bool, error) { } func main() { + if testing.Testing() { + println("not running a test at the moment, testing.Testing() should return false") + } testing.Init() flag.Set("test.run", ".*/B") m := testing.MainStart(matchStringOnly(fakeMatchString /*regexp.MatchString*/), tests, benchmarks, fuzzes, examples) |