Lints and suggestions for the Nix programming language
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

chore: explicit snapshot names

+4 -4
+4 -4
bin/tests/main.rs
··· 14 14 #[test] 15 15 fn [<$tname _lint>](){ 16 16 let file_path = concat!("tests/data/", stringify!($tname), ".nix"); 17 - test_cli(file_path, &["check"]); 17 + test_cli(concat!(stringify!($tname), "_lint"), file_path, &["check"]); 18 18 } 19 19 20 20 #[test] 21 21 fn [<$tname _fix>](){ 22 22 let file_path = concat!("tests/data/", stringify!($tname), ".nix"); 23 - test_cli(file_path, &["fix", "--dry-run"]); 23 + test_cli(concat!(stringify!($tname), "_fix"), file_path, &["fix", "--dry-run"]); 24 24 } 25 25 } 26 26 ··· 28 28 } 29 29 } 30 30 31 - fn test_cli(file_path: &str, args: &[&str]) { 31 + fn test_cli(test_name: &str, file_path: &str, args: &[&str]) { 32 32 let output = std::process::Command::new("cargo") 33 33 .arg("run") 34 34 .arg("--") ··· 40 40 let stdout = strip_ansi_escapes::strip(output.stdout).unwrap(); 41 41 let stdout = String::from_utf8(stdout).unwrap(); 42 42 43 - insta::assert_snapshot!(&stdout); 43 + insta::assert_snapshot!(test_name, &stdout); 44 44 } 45 45 46 46 test_lint! {