mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-03-01 14:38:29 +00:00
commandv: fix dir tests on non-NT (#764)
This commit is contained in:
parent
9a5d69c842
commit
6758c3f400
1 changed files with 8 additions and 6 deletions
|
@ -118,18 +118,20 @@ TEST(commandv, testSameDir_willHappenWithColonBlank2) {
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(commandv, test_DirPaths_wontConsiderDirectoriesExecutable) {
|
TEST(commandv, test_DirPaths_wontConsiderDirectoriesExecutable) {
|
||||||
|
CHECK_NE(-1, setenv("PATH", ":bin", true));
|
||||||
EXPECT_NE(-1, mkdir("Cursors", 0755));
|
EXPECT_NE(-1, mkdir("Cursors", 0755));
|
||||||
EXPECT_EQ(NULL, commandv("Cursors", pathbuf, sizeof(pathbuf)));
|
EXPECT_EQ(NULL, commandv("Cursors", pathbuf, sizeof(pathbuf)));
|
||||||
EXPECT_EQ(errno, ENOENT);
|
if (IsWindows()) {
|
||||||
|
EXPECT_EQ(errno, ENOENT);
|
||||||
|
} else {
|
||||||
|
EXPECT_EQ(errno, EACCES);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(commandv, test_DirPaths_wontConsiderDirectoriesExecutable2) {
|
TEST(commandv, test_DirPaths_wontConsiderDirectoriesExecutable2) {
|
||||||
|
CHECK_NE(-1, setenv("PATH", ":bin", true));
|
||||||
EXPECT_NE(-1, mkdir("this_is_a_directory.com", 0755));
|
EXPECT_NE(-1, mkdir("this_is_a_directory.com", 0755));
|
||||||
EXPECT_EQ(NULL,
|
EXPECT_EQ(NULL,
|
||||||
commandv("this_is_a_directory.com", pathbuf, sizeof(pathbuf)));
|
commandv("this_is_a_directory.com", pathbuf, sizeof(pathbuf)));
|
||||||
if (IsWindows()) {
|
EXPECT_EQ(errno, EACCES);
|
||||||
EXPECT_EQ(errno, EACCES);
|
|
||||||
} else {
|
|
||||||
EXPECT_EQ(errno, ENOENT);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue