Skip to content

Commit

Permalink
tests: add exclusion tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Nov 27, 2024
1 parent ff16e05 commit f4240a2
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 7 deletions.
6 changes: 5 additions & 1 deletion analyzer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,17 @@ func TestAnalyzer(t *testing.T) {
settings: recvcheck.Settings{},
},
{
desc: "excluded",
desc: "builtin",
settings: recvcheck.Settings{},
},
{
desc: "disablebuiltin",
settings: recvcheck.Settings{DisableBuiltin: true},
},
{
desc: "exclusions",
settings: recvcheck.Settings{Exclusions: []string{"SQL.Value"}},
},
}

for _, test := range testCases {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package excluded
package builtin

type Binary struct{}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package excluded
package builtin

type Gob struct{}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package excluded
package builtin

type JSON struct{}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package excluded
package builtin

type Text struct{}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package excluded
package builtin

import "encoding/xml"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package excluded
package builtin

type Node struct{}

Expand Down
13 changes: 13 additions & 0 deletions testdata/src/exclusions/exclusions.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package exclusions

import "database/sql/driver"

type SQL struct{}

func (s SQL) Value() (driver.Value, error) {
panic("not implemented")
}

func (s *SQL) Scan(src any) error {
panic("not implemented")
}

0 comments on commit f4240a2

Please # to comment.