Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
max-sixty committed Sep 26, 2024
1 parent 6a8d6fa commit d6eb177
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions cargo-insta/tests/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
use std::fs;
use std::path::{Path, PathBuf};
use std::process::Command;
/// Integration tests which allow creating a full repo, running `cargo-insta`
/// and then checking the output.
///
Expand All @@ -17,7 +14,10 @@ use std::process::Command;
/// repeatedly running the tests locally. To demonstrate the effect, name crates
/// the same...). This also causes issues when running the same tests
/// concurrently.
use std::{collections::HashMap, os::unix::fs::PermissionsExt};
use std::collections::HashMap;
use std::fs;
use std::path::{Path, PathBuf};
use std::process::Command;
use std::{env, fs::remove_dir_all};

use ignore::WalkBuilder;
Expand Down Expand Up @@ -1176,10 +1176,6 @@ fn test_insta_workspace_root() {
file_name_str.starts_with("insta_workspace_root_test-") // Matches our test name
&& !file_name_str.contains('.') // Doesn't have an extension (it's the executable, not a metadata file)
&& entry.metadata().map(|m| m.is_file()).unwrap_or(false) // Is a file, not a directory
&& entry
.metadata()
.map(|m| m.permissions().mode() & 0o111 != 0)
.unwrap_or(false) // Has executable permissions
})
.map(|entry| entry.path())
.expect("Failed to find test binary")
Expand Down

0 comments on commit d6eb177

Please sign in to comment.