Skip to content

Commit 7906e82

Browse files
committed
Check prototypes as golden tests
1 parent 08e1687 commit 7906e82

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

tests/formatting/golden.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,7 @@ fn show_diff(original: &str, formatted: &str, file_path: &Path) {
5555
}
5656
}
5757

58-
#[test]
59-
fn ensure_identical_output() {
60-
// Read all .tq files from examples/prototype/
61-
let dir = Path::new("tests/golden/");
62-
58+
fn check_directory(dir: &Path) {
6359
// Ensure the directory exists
6460
assert!(dir.exists(), "examples directory missing");
6561

@@ -121,3 +117,9 @@ fn ensure_identical_output() {
121117
panic!("All examples must format unchanged");
122118
}
123119
}
120+
121+
#[test]
122+
fn ensure_identical_output() {
123+
check_directory(Path::new("tests/golden/"));
124+
check_directory(Path::new("examples/prototype/"));
125+
}

0 commit comments

Comments
 (0)