Skip to content

Commit

Permalink
Renamed test function for query rule skiplist.
Browse files Browse the repository at this point in the history
  • Loading branch information
rhodeon authored and kyleconroy committed Nov 25, 2024
1 parent a82fcb4 commit 474ee13
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions internal/metadata/meta_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func TestParseQueryFlags(t *testing.T) {
}
}

func TestParseQueryRuleBlocklist(t *testing.T) {
func TestParseQueryRuleSkiplist(t *testing.T) {
for _, comments := range [][]string{
{
" name: CreateFoo :one",
Expand All @@ -158,7 +158,7 @@ func TestParseQueryRuleBlocklist(t *testing.T) {
" @sqlc-vet-disable delete-without-where ",
},
} {
_, flags, ruleBlocklist, err := ParseCommentFlags(comments)
_, flags, ruleSkiplist, err := ParseCommentFlags(comments)
if err != nil {
t.Errorf("expected comments to parse, got err: %s", err)
}
Expand All @@ -167,16 +167,16 @@ func TestParseQueryRuleBlocklist(t *testing.T) {
t.Errorf("expected @sqlc-vet-disable flag not found")
}

if _, ok := ruleBlocklist["sqlc/db-prepare"]; !ok {
t.Errorf("expected rule not found in blocklist")
if _, ok := ruleSkiplist["sqlc/db-prepare"]; !ok {
t.Errorf("expected rule not found in skiplist")
}

if _, ok := ruleBlocklist["delete-without-where"]; !ok {
t.Errorf("expected rule not found in blocklist")
if _, ok := ruleSkiplist["delete-without-where"]; !ok {
t.Errorf("expected rule not found in skiplist")
}

if _, ok := ruleBlocklist["update-without-where"]; ok {
t.Errorf("unexpected rule found in blocklist")
if _, ok := ruleSkiplist["update-without-where"]; ok {
t.Errorf("unexpected rule found in skiplist")
}
}
}

0 comments on commit 474ee13

Please sign in to comment.