fix: normalize away './' path prefixes
This commit is contained in:
parent
5b23998376
commit
e053a0dcf4
5 changed files with 53 additions and 10 deletions
19
test/tests_project_manager.zig
Normal file
19
test/tests_project_manager.zig
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
const std = @import("std");
|
||||
const pm = @import("project_manager");
|
||||
|
||||
test "normalize_file_path_dot_prefix" {
|
||||
try std.testing.expectEqualStrings("example.txt", pm.normalize_file_path_dot_prefix("example.txt"));
|
||||
try std.testing.expectEqualStrings("/example.txt", pm.normalize_file_path_dot_prefix("/example.txt"));
|
||||
try std.testing.expectEqualStrings("example.txt", pm.normalize_file_path_dot_prefix("./example.txt"));
|
||||
try std.testing.expectEqualStrings("example.txt", pm.normalize_file_path_dot_prefix("././example.txt"));
|
||||
try std.testing.expectEqualStrings("example.txt", pm.normalize_file_path_dot_prefix(".//example.txt"));
|
||||
try std.testing.expectEqualStrings("example.txt", pm.normalize_file_path_dot_prefix(".//./example.txt"));
|
||||
try std.testing.expectEqualStrings("example.txt", pm.normalize_file_path_dot_prefix(".//.//example.txt"));
|
||||
try std.testing.expectEqualStrings("../example.txt", pm.normalize_file_path_dot_prefix("./../example.txt"));
|
||||
try std.testing.expectEqualStrings("../example.txt", pm.normalize_file_path_dot_prefix(".//../example.txt"));
|
||||
try std.testing.expectEqualStrings("../example.txt", pm.normalize_file_path_dot_prefix("././../example.txt"));
|
||||
try std.testing.expectEqualStrings("../example.txt", pm.normalize_file_path_dot_prefix("././/../example.txt"));
|
||||
try std.testing.expectEqualStrings("../example.txt", pm.normalize_file_path_dot_prefix(".//.//../example.txt"));
|
||||
try std.testing.expectEqualStrings("./", pm.normalize_file_path_dot_prefix("./"));
|
||||
try std.testing.expectEqualStrings(".", pm.normalize_file_path_dot_prefix("."));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue