Skip to content

Commit

Permalink
internal: preparing tests for fix (#911)
Browse files Browse the repository at this point in the history
  • Loading branch information
benfdking authored Oct 30, 2024
1 parent c8d9331 commit 63ed288
Show file tree
Hide file tree
Showing 13 changed files with 9 additions and 9 deletions.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
== [tests/ui/LT01_LT012.sql] FAIL
== [tests/lint/LT01_LT012.sql] FAIL
L: 1 | P: 7 | LT01 | Expected only single space before "1". Found " ".
| [layout.spacing]
L: 1 | P: 11 | LT12 | Files must end with a single trailing newline.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
== [tests/ui/hql_file.hql] FAIL
== [tests/lint/hql_file.hql] FAIL
L: 1 | P: 7 | LT01 | Expected only single space before "1". Found " ".
| [layout.spacing]
L: 1 | P: 11 | LT12 | Files must end with a single trailing newline.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
== [tests/ui/test_fail_whitespace_before_comma.sql] FAIL
== [tests/lint/test_fail_whitespace_before_comma.sql] FAIL
L: 1 | P: 8 | AL03 | Column expression without alias. Use explicit `AS`
| clause. [aliasing.expression]
L: 1 | P: 9 | LT01 | Unexpected whitespace before comma. [layout.spacing]
Expand Down
12 changes: 6 additions & 6 deletions crates/cli/tests/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ fn main() {
} else {
"release"
};
let mut test_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
test_dir.push("tests/ui");
let mut lint_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
lint_dir.push("tests/lint");

// Iterate over each test file in the directory
for entry in fs::read_dir(&test_dir).unwrap() {
for entry in fs::read_dir(&lint_dir).unwrap() {
let entry = entry.unwrap();
let path = entry.path();

Expand Down Expand Up @@ -51,9 +51,9 @@ fn main() {
let stdout_str = std::str::from_utf8(&output.stdout).unwrap();
let exit_code_str = output.status.code().unwrap().to_string();

let test_dir_str = test_dir.to_string_lossy().to_string();
let stderr_normalized: String = stderr_str.replace(&test_dir_str, "tests/ui");
let stdout_normalized: String = stdout_str.replace(&test_dir_str, "tests/ui");
let test_dir_str = lint_dir.to_string_lossy().to_string();
let stderr_normalized: String = stderr_str.replace(&test_dir_str, "tests/lint");
let stdout_normalized: String = stdout_str.replace(&test_dir_str, "tests/lint");

expect_file![expected_output_path_stderr].assert_eq(&stderr_normalized);
expect_file![expected_output_path_stdout].assert_eq(&stdout_normalized);
Expand Down

0 comments on commit 63ed288

Please sign in to comment.