Skip to content

Commit a357bd8

Browse files
author
ScriptedAlchemy
committed
test: canonicalize storage suite profile roots
1 parent 1d76e9a commit a357bd8

5 files changed

Lines changed: 5 additions & 40 deletions

File tree

tests/storage_suite/branch_drift_test.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,7 @@ impl Drop for HomeEnvGuard {
5757
}
5858

5959
fn canonical_temp_path(path: &Path) -> PathBuf {
60-
#[cfg(windows)]
61-
{
62-
path.to_path_buf()
63-
}
64-
#[cfg(not(windows))]
65-
{
66-
path.canonicalize().unwrap_or_else(|_| path.to_path_buf())
67-
}
60+
path.canonicalize().unwrap_or_else(|_| path.to_path_buf())
6861
}
6962

7063
fn git_output(project: &Path, args: &[&str]) -> Output {

tests/storage_suite/migrate_inventory_test.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,7 @@ use tracedecay::migrate::manifest::{
1616
};
1717

1818
fn canonical_temp_path(path: &Path) -> PathBuf {
19-
#[cfg(windows)]
20-
{
21-
path.to_path_buf()
22-
}
23-
#[cfg(not(windows))]
24-
{
25-
path.canonicalize().unwrap_or_else(|_| path.to_path_buf())
26-
}
19+
path.canonicalize().unwrap_or_else(|_| path.to_path_buf())
2720
}
2821

2922
fn with_env_vars<T>(vars: &[(&str, Option<&Path>)], f: impl FnOnce() -> T) -> T {

tests/storage_suite/migration_manifest_test.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,7 @@ fn manifest_for(protocol: MigrationProtocol, migration_id: &str) -> MigrationMan
4343
}
4444

4545
fn canonical_temp_path(path: &Path) -> PathBuf {
46-
#[cfg(windows)]
47-
{
48-
path.to_path_buf()
49-
}
50-
#[cfg(not(windows))]
51-
{
52-
path.canonicalize().unwrap_or_else(|_| path.to_path_buf())
53-
}
46+
path.canonicalize().unwrap_or_else(|_| path.to_path_buf())
5447
}
5548

5649
#[cfg(unix)]

tests/storage_suite/profile_storage_migration_test.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,7 @@ impl Drop for HomeEnvGuard {
7070
}
7171

7272
fn canonical_temp_path(path: &Path) -> PathBuf {
73-
#[cfg(windows)]
74-
{
75-
path.to_path_buf()
76-
}
77-
#[cfg(not(windows))]
78-
{
79-
path.canonicalize().unwrap_or_else(|_| path.to_path_buf())
80-
}
73+
path.canonicalize().unwrap_or_else(|_| path.to_path_buf())
8174
}
8275

8376
fn portable_relpath(path: &str) -> String {

tests/storage_suite/storage_resolver_test.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,7 @@ fn write_enrollment(root: &Path) {
7777
}
7878

7979
fn canonical_temp_path(path: &Path) -> PathBuf {
80-
#[cfg(windows)]
81-
{
82-
path.to_path_buf()
83-
}
84-
#[cfg(not(windows))]
85-
{
86-
path.canonicalize().unwrap_or_else(|_| path.to_path_buf())
87-
}
80+
path.canonicalize().unwrap_or_else(|_| path.to_path_buf())
8881
}
8982

9083
fn test_home(dir: &TempDir) -> PathBuf {

0 commit comments

Comments
 (0)