fix: normalize away './' path prefixes
This commit is contained in:
parent
5b23998376
commit
e053a0dcf4
5 changed files with 53 additions and 10 deletions
|
|
@ -2,6 +2,7 @@ const std = @import("std");
|
|||
pub const buffer = @import("tests_buffer.zig");
|
||||
pub const color = @import("tests_color.zig");
|
||||
pub const helix = @import("tests_helix.zig");
|
||||
pub const project_manager = @import("tests_project_manager.zig");
|
||||
|
||||
test {
|
||||
std.testing.refAllDecls(@This());
|
||||
|
|
|
|||
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