Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Commit

Permalink
Stabilize test
Browse files Browse the repository at this point in the history
  • Loading branch information
arendjr committed Jul 28, 2023
1 parent ccab011 commit 82f2336
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 100 deletions.
25 changes: 17 additions & 8 deletions crates/rome_cli/tests/commands/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,6 @@ fn fs_error_infinite_symlink_expansion_to_dirs() {

#[test]
fn fs_error_infinite_symlink_expansion_to_files() {
let fs = MemoryFileSystem::default();
let mut console = BufferConsole::default();

let root_path = temp_dir().join("check_rome_test_infinite_symlink_expansion_to_files");
Expand Down Expand Up @@ -917,13 +916,23 @@ fn fs_error_infinite_symlink_expansion_to_files() {

assert!(result.is_err(), "run_cli returned {result:?}");

assert_cli_snapshot(SnapshotPayload::new(
module_path!(),
"fs_error_infinite_symlink_expansion_to_files",
fs,
console,
result,
));
// Don't use a snapshot here, since the diagnostics can be reported in
// arbitrary order:
assert!(console
.out_buffer
.iter()
.flat_map(|msg| msg.content.0.iter())
.any(|node| node.content.contains("Deeply nested symlink expansion")));
assert!(console
.out_buffer
.iter()
.flat_map(|msg| msg.content.0.iter())
.any(|node| node.content.contains("/prefix/symlink1 internalError/fs")));
assert!(console
.out_buffer
.iter()
.flat_map(|msg| msg.content.0.iter())
.any(|node| node.content.contains("/foo/bar/symlink2 internalError/fs")));
}

#[test]
Expand Down
25 changes: 17 additions & 8 deletions crates/rome_cli/tests/commands/lint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,6 @@ fn fs_error_infinite_symlink_expansion_to_dirs() {

#[test]
fn fs_error_infinite_symlink_expansion_to_files() {
let fs = MemoryFileSystem::default();
let mut console = BufferConsole::default();

let root_path = temp_dir().join("lint_rome_test_infinite_symlink_expansion_to_files");
Expand Down Expand Up @@ -915,13 +914,23 @@ fn fs_error_infinite_symlink_expansion_to_files() {

assert!(result.is_err(), "run_cli returned {result:?}");

assert_cli_snapshot(SnapshotPayload::new(
module_path!(),
"fs_error_infinite_symlink_expansion_to_files",
fs,
console,
result,
));
// Don't use a snapshot here, since the diagnostics can be reported in
// arbitrary order:
assert!(console
.out_buffer
.iter()
.flat_map(|msg| msg.content.0.iter())
.any(|node| node.content.contains("Deeply nested symlink expansion")));
assert!(console
.out_buffer
.iter()
.flat_map(|msg| msg.content.0.iter())
.any(|node| node.content.contains("/prefix/symlink1 internalError/fs")));
assert!(console
.out_buffer
.iter()
.flat_map(|msg| msg.content.0.iter())
.any(|node| node.content.contains("/foo/bar/symlink2 internalError/fs")));
}

#[test]
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit 82f2336

Please sign in to comment.