From 335d9a9f5e820a154f34bd36c4c51f3d9101b609 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Geis?= Date: Mon, 1 May 2023 11:58:55 +0900 Subject: [PATCH] Fix warnings in tests on non-Unix platforms --- tests/test_diff_command.rs | 3 +-- tests/test_edit_command.rs | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/test_diff_command.rs b/tests/test_diff_command.rs index 23d6540ce..44e140803 100644 --- a/tests/test_diff_command.rs +++ b/tests/test_diff_command.rs @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::path::PathBuf; - use common::TestEnvironment; pub mod common; @@ -135,6 +133,7 @@ fn test_diff_types() { #[cfg(unix)] { use std::os::unix::fs::PermissionsExt; + use std::path::PathBuf; // Executable test_env.jj_cmd_success(&repo_path, &["new", "root", "-m=executable"]); diff --git a/tests/test_edit_command.rs b/tests/test_edit_command.rs index 9d251544d..721e9ac91 100644 --- a/tests/test_edit_command.rs +++ b/tests/test_edit_command.rs @@ -14,7 +14,7 @@ use std::path::Path; -use crate::common::{get_stderr_string, TestEnvironment}; +use crate::common::TestEnvironment; pub mod common; @@ -66,6 +66,8 @@ fn test_edit() { // Windows says "Access is denied" when trying to delete the object file. #[cfg(unix)] fn test_edit_current_wc_commit_missing() { + use crate::common::get_stderr_string; + // Test that we get a reasonable error message when the current working-copy // commit is missing let test_env = TestEnvironment::default();