Skip to content
Prev Previous commit
Renamed test function for query rule skiplist.
  • Loading branch information
rhodeon authored and kyleconroy committed Nov 25, 2024
commit 474ee13f12f7a570ac7524e9c01c1e48fb2c0a4d
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")
}
}
}
Loading