Skip to content

Commit 4d81389

Browse files
Mikachu2333ccmywish
authored andcommitted
add tests
1 parent 0768539 commit 4d81389

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/xy.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,13 @@ main (int argc, char const *argv[])
103103
assert (xy_file_exist (xy_win_powershell_profile));
104104
assert (true == xy_file_exist (xy_win_powershellv5_profile));
105105
assert (xy_dir_exist ("C:\\Users"));
106+
assert_str (xy_normalize_path ("C:\\a bc\\def\\"), "C:\\a bc\\def\\");
107+
assert_str (xy_normalize_path ("a/b c/d"), "a\\b c\\d");
108+
assert_str (xy_normalize_path ("a/b c/d/"), "a\\b c\\d\\");
109+
assert_str (xy_parent_dir ("a/b c/d"), "a\\b c");
110+
assert_str (xy_parent_dir ("a/b c\\d/"), "a\\b c");
111+
assert_str (xy_parent_dir (xy_normalize_path ("~/")), "C:\\Users");
112+
assert_str (xy_parent_dir (xy_normalize_path ("~")), "C:\\Users");
106113
}
107114
else
108115
{
@@ -115,6 +122,8 @@ main (int argc, char const *argv[])
115122
assert (xy_file_exist (xy_bashrc));
116123
}
117124
assert (xy_dir_exist ("/etc"));
125+
assert_str (xy_normalize_path ("a\\b c\\d"), "a/b c/d");
126+
assert_str (xy_normalize_path ("a\\b c\\d\\"), "a/b c/d/");
118127
}
119128

120129
println (xy_normalize_path (" \n ~/haha/test/123 \n\r "));

0 commit comments

Comments
 (0)