aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/syntax/scanner_test.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2019-10-29 09:27:57 -0700
committerRobert Griesemer <gri@golang.org>2019-11-06 17:02:19 +0000
commit4cb926001cbc068dac62012d86ed1dfbd0a66690 (patch)
tree801658d1de16c1ea23178f2c88f35d371e675027 /src/cmd/compile/internal/syntax/scanner_test.go
parenta5936a489462a2f68ee2ae1a53dd48c0458029a7 (diff)
downloadgo-4cb926001cbc068dac62012d86ed1dfbd0a66690.tar.gz
go-4cb926001cbc068dac62012d86ed1dfbd0a66690.zip
cmd/compile/internal/syntax: silence test function output
Don't print to stdout in non-verbose (-v) test mode. Exception: Timing output (2 lines) of TestStdLib. If we want to disable that as well we should use another flag to differenciate between -verbose output and measurement results. Leaving alone for now. Fixes #35223. Change-Id: Ie8160760e8db1138f9031888d654eaeab202128c Reviewed-on: https://go-review.googlesource.com/c/go/+/204039 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/syntax/scanner_test.go')
-rw-r--r--src/cmd/compile/internal/syntax/scanner_test.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/syntax/scanner_test.go b/src/cmd/compile/internal/syntax/scanner_test.go
index 717deb9073..d76231a4af 100644
--- a/src/cmd/compile/internal/syntax/scanner_test.go
+++ b/src/cmd/compile/internal/syntax/scanner_test.go
@@ -30,6 +30,9 @@ func TestScanner(t *testing.T) {
if s.tok == _EOF {
break
}
+ if !testing.Verbose() {
+ continue
+ }
switch s.tok {
case _Name:
fmt.Println(s.line, s.tok, "=>", s.lit)