From 243d34990ace8ee665c23bd812ab6cbf5a89943f Mon Sep 17 00:00:00 2001 From: alingse Date: Fri, 22 Jul 2022 09:12:26 +0800 Subject: [PATCH] add more support for testing --- asasalint.go | 2 +- testdata/src/basic/std_test.go | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/asasalint.go b/asasalint.go index 544bad8..f34516a 100644 --- a/asasalint.go +++ b/asasalint.go @@ -16,7 +16,7 @@ import ( "golang.org/x/tools/go/ast/inspector" ) -const BuiltinExclusions = `^(fmt|log|logger)\.(Print|Fprint|Sprint|Fatal|Panic|Error|Warn|Warning|Info|Debug)(|f|ln)$` +const BuiltinExclusions = `^(fmt|log|logger|t|)\.(Print|Fprint|Sprint|Fatal|Panic|Error|Warn|Warning|Info|Debug|Log)(|f|ln)$` type LinterSetting struct { Exclude []string diff --git a/testdata/src/basic/std_test.go b/testdata/src/basic/std_test.go index 778a849..5b4c16b 100644 --- a/testdata/src/basic/std_test.go +++ b/testdata/src/basic/std_test.go @@ -35,3 +35,15 @@ func TestStd(t *testing.T) { log.Panicf("%v", a) log.Panic(a) } + +func TestTest(t *testing.T) { + var a = []any{1, 2, 3} + if len(a) != 3 { + t.Log(a) + t.Logf("%v", a) + t.Error(a) + t.Errorf("%v", a) + t.Fatal(a) + t.Fatalf("%v", a) + } +}