Skip to content

Commit 08dc70e

Browse files
authored
tests: move test to proper lint (#408)
was put in the wrong file in c3979a9
1 parent 2b69ef5 commit 08dc70e

File tree

4 files changed

+19
-14
lines changed

4 files changed

+19
-14
lines changed

linter/src/rules/adding_field_with_default.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ pub fn adding_field_with_default(
4545
.filter(|x| !x.is_empty())
4646
.collect();
4747

48-
// println!("{:#?}", non_volatile_funcs);
4948
for raw_stmt in tree {
5049
match &raw_stmt.stmt {
5150
Stmt::AlterTableStmt(stmt) => {

linter/src/rules/ban_char_field.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,4 @@ COMMIT;
7777
"#;
7878
assert_debug_snapshot!(lint_sql(sql));
7979
}
80-
#[test]
81-
fn regression_with_indexing_2() {
82-
let sql = r#"
83-
BEGIN;
84-
ALTER TABLE "core_recipe" ADD COLUMN "foo" integer DEFAULT 10;
85-
ALTER TABLE "core_recipe" ADD CONSTRAINT foo_not_null
86-
CHECK ("foo" IS NOT NULL) NOT VALID;
87-
COMMIT;
88-
BEGIN;
89-
90-
"#;
91-
assert_debug_snapshot!(lint_sql(sql));
92-
}
9380
}

linter/src/rules/constraint_missing_not_valid.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,4 +265,18 @@ ALTER TABLE accounts VALIDATE CONSTRAINT positive_balance;
265265

266266
assert_debug_snapshot!(lint_sql(ok_sql));
267267
}
268+
269+
#[test]
270+
fn regression_with_indexing_2() {
271+
let sql = r#"
272+
BEGIN;
273+
ALTER TABLE "core_recipe" ADD COLUMN "foo" integer DEFAULT 10;
274+
ALTER TABLE "core_recipe" ADD CONSTRAINT foo_not_null
275+
CHECK ("foo" IS NOT NULL) NOT VALID;
276+
COMMIT;
277+
BEGIN;
278+
279+
"#;
280+
assert_debug_snapshot!(lint_sql(sql));
281+
}
268282
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
source: linter/src/rules/constraint_missing_not_valid.rs
3+
expression: lint_sql(sql)
4+
---
5+
[]

0 commit comments

Comments
 (0)