Skip to content

Commit a05a1fa

Browse files
committed
fix
1 parent 3b432bc commit a05a1fa

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

crates/cli/src/reporter.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ pub fn get_comment_body(files: &[ViolationContent], version: &str) -> String {
562562
mod test_github_comment {
563563
use super::*;
564564

565-
use insta::assert_display_snapshot;
565+
use insta::assert_snapshot;
566566

567567
/// Most cases, hopefully, will be a single migration for a given PR, but
568568
/// let's check the case of multiple migrations
@@ -593,7 +593,7 @@ SELECT 1;
593593

594594
let body = get_comment_body(&violations, "0.2.3");
595595

596-
assert_display_snapshot!(body);
596+
assert_snapshot!(body);
597597
}
598598

599599
/// Even when we don't have violations we still want to output the SQL for
@@ -628,7 +628,7 @@ ALTER TABLE "core_recipe" ADD COLUMN "foo" integer DEFAULT 10;
628628

629629
let body = get_comment_body(&violations, "0.2.3");
630630

631-
assert_display_snapshot!(body);
631+
assert_snapshot!(body);
632632
}
633633

634634
/// Ideally the logic won't leave a comment when there are no migrations but
@@ -639,7 +639,7 @@ ALTER TABLE "core_recipe" ADD COLUMN "foo" integer DEFAULT 10;
639639

640640
let body = get_comment_body(&violations, "0.2.3");
641641

642-
assert_display_snapshot!(body);
642+
assert_snapshot!(body);
643643
}
644644
}
645645

@@ -671,7 +671,7 @@ mod test_reporter {
671671
use crate::reporter::{pretty_violations, print_violations, Reporter};
672672

673673
use console::strip_ansi_codes;
674-
use insta::{assert_debug_snapshot, assert_display_snapshot};
674+
use insta::{assert_debug_snapshot, assert_snapshot};
675675

676676
use squawk_linter::{
677677
check_sql_with_rule,
@@ -703,7 +703,7 @@ SELECT 1;
703703
);
704704
assert!(res.is_ok());
705705

706-
assert_display_snapshot!(String::from_utf8_lossy(&buff), @r"
706+
assert_snapshot!(String::from_utf8_lossy(&buff), @r"
707707
main.sql:1:0: warning: adding-required-field Adding a NOT NULL field without a DEFAULT will fail for a populated table. Make the field nullable or add a non-VOLATILE DEFAULT (Postgres 11+).
708708
main.sql:3:1: warning: adding-required-field Adding a NOT NULL field without a DEFAULT will fail for a populated table. Make the field nullable or add a non-VOLATILE DEFAULT (Postgres 11+).
709709
");
@@ -728,7 +728,7 @@ SELECT 1;
728728

729729
assert!(res.is_ok());
730730
// remove the color codes so tests behave in CI as they do locally
731-
assert_display_snapshot!(strip_ansi_codes(&String::from_utf8_lossy(&buff)));
731+
assert_snapshot!(strip_ansi_codes(&String::from_utf8_lossy(&buff)));
732732
}
733733
#[test]
734734
fn display_no_violations_tty() {
@@ -742,7 +742,7 @@ SELECT 1;
742742

743743
assert!(res.is_ok());
744744
// remove the color codes so tests behave in CI as they do locally
745-
assert_display_snapshot!(strip_ansi_codes(&String::from_utf8_lossy(&buff)));
745+
assert_snapshot!(strip_ansi_codes(&String::from_utf8_lossy(&buff)));
746746
}
747747

748748
#[test]
@@ -763,7 +763,7 @@ SELECT 1;
763763
);
764764

765765
assert!(res.is_ok());
766-
assert_display_snapshot!(String::from_utf8_lossy(&buff), @r#"
766+
assert_snapshot!(String::from_utf8_lossy(&buff), @r#"
767767
[{"file":"main.sql","line":1,"column":0,"level":"Warning","messages":[{"Note":"Adding a NOT NULL field without a DEFAULT will fail for a populated table."},{"Help":"Make the field nullable or add a non-VOLATILE DEFAULT (Postgres 11+)."}],"rule_name":"adding-required-field"},{"file":"main.sql","line":3,"column":1,"level":"Warning","messages":[{"Note":"Adding a NOT NULL field without a DEFAULT will fail for a populated table."},{"Help":"Make the field nullable or add a non-VOLATILE DEFAULT (Postgres 11+)."}],"rule_name":"adding-required-field"}]
768768
"#);
769769
}
@@ -872,6 +872,6 @@ SELECT 1;
872872
.iter()
873873
.map(|v| v.sql.clone())
874874
.collect::<String>();
875-
assert_display_snapshot!(columns);
875+
assert_snapshot!(columns);
876876
}
877877
}

crates/linter/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ pub fn check_sql_with_rule(
432432
#[cfg(test)]
433433
mod test_rules {
434434
use super::*;
435-
use insta::{assert_debug_snapshot, assert_display_snapshot};
435+
use insta::{assert_debug_snapshot, assert_snapshot};
436436
use std::convert::TryFrom;
437437
use std::str::FromStr;
438438

@@ -462,7 +462,7 @@ mod test_rules {
462462
#[test]
463463
fn rule_names_display_snap() {
464464
let rule_names: Vec<String> = RULES.iter().map(|r| r.name.to_string()).collect();
465-
assert_display_snapshot!(rule_names.join("\n"));
465+
assert_snapshot!(rule_names.join("\n"));
466466
}
467467

468468
/// Ensure we stort the resulting violations by where they occur in the file.

0 commit comments

Comments
 (0)