Skip to content

Commit 2c820b5

Browse files
committed
bug fix in test failing in git actions.
1 parent f5362a2 commit 2c820b5

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ members = [
66
resolver = "2"
77

88
[workspace.package]
9-
version = "0.2.2"
9+
version = "0.2.3"
1010
edition = "2021"
1111
rust-version = "1.86"
1212
license = "Apache-2.0"

core/src/utils.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -852,9 +852,15 @@ mod tests {
852852

853853

854854
// Test absolute path that does not match any provided folders
855+
//
855856
let unmatched_path = "/some/other/path/spec.yaml".to_string();
856857
let result = to_relative_identifier(&unmatched_path, &base_path, &specifications_folder, &external_folders)
857858
.expect("Should return absolute path when no match is found");
858-
assert_eq!(result, "../../../../some/other/path/spec.yaml", "Failed unmatched absolute path check");
859+
860+
// Dynamically compute the expected path (resutl must be a path relative to a base_path)
861+
let expected = pathdiff::diff_paths(&unmatched_path, &base_path)
862+
.expect("Failed to compute relative path");
863+
864+
assert_eq!(result, expected.to_string_lossy(), "Failed unmatched absolute path check");
859865
}
860866
}

0 commit comments

Comments
 (0)