Skip to content

Commit

Permalink
Add valid case coverage to TestHasDirective unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
nnutter committed Mar 13, 2020
1 parent 22b4caf commit 33d8aa8
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions faillint/faillint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,30 @@ func TestHasDirective(t *testing.T) {
message: fmt.Sprintf(unexpectedFileIgnoreTemplate, "file-ignore"),
},
},
{
name: "valid ignore",
input: input{
comments: []*ast.Comment{
{Text: "//faillint:ignore reason"},
},
option: ignoreKey,
},
expected: expected{
out: true,
},
},
{
name: "valid file-ignore",
input: input{
comments: []*ast.Comment{
{Text: "//faillint:file-ignore reason"},
},
option: fileIgnoreKey,
},
expected: expected{
out: true,
},
},
} {
t.Run(tcase.name, func(t *testing.T) {
var diagnostic analysis.Diagnostic
Expand Down

0 comments on commit 33d8aa8

Please sign in to comment.