mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-08 10:50:28 +00:00
clang-format
This commit is contained in:
parent
c77063ec43
commit
52c6050ba7
2 changed files with 8 additions and 7 deletions
|
@ -685,7 +685,8 @@ int _cocmd(int argc, char **argv, char **envp) {
|
||||||
unsupported['('] = true;
|
unsupported['('] = true;
|
||||||
unsupported[')'] = true;
|
unsupported[')'] = true;
|
||||||
unsupported['{'] = true;
|
unsupported['{'] = true;
|
||||||
unsupported['}'] = false; // Perl t/op/exec.t depends on unpaired } being passed from the shell to Perl
|
unsupported['}'] = false; // Perl t/op/exec.t depends on unpaired } being
|
||||||
|
// passed from the shell to Perl
|
||||||
if (!_weaken(glob)) {
|
if (!_weaken(glob)) {
|
||||||
unsupported['*'] = true;
|
unsupported['*'] = true;
|
||||||
unsupported['?'] = true;
|
unsupported['?'] = true;
|
||||||
|
|
|
@ -71,7 +71,7 @@ TEST(system, testStderrRedirect_toStdout) {
|
||||||
ASSERT_NE(-1, dup2(1, 2));
|
ASSERT_NE(-1, dup2(1, 2));
|
||||||
bool success = false;
|
bool success = false;
|
||||||
if (WEXITSTATUS(system("echo aaa 2>&1")) == 0) {
|
if (WEXITSTATUS(system("echo aaa 2>&1")) == 0) {
|
||||||
success = read(pipefd[0], buf, sizeof(buf)-1) == (sizeof(buf)-1);
|
success = read(pipefd[0], buf, sizeof(buf) - 1) == (sizeof(buf) - 1);
|
||||||
}
|
}
|
||||||
ASSERT_NE(-1, dup2(stderrBack, 2));
|
ASSERT_NE(-1, dup2(stderrBack, 2));
|
||||||
ASSERT_EQ(true, success);
|
ASSERT_EQ(true, success);
|
||||||
|
@ -84,7 +84,7 @@ TEST(system, testStderrRedirect_toStdout) {
|
||||||
ASSERT_NE(-1, dup2(1, 2));
|
ASSERT_NE(-1, dup2(1, 2));
|
||||||
success = false;
|
success = false;
|
||||||
if (WEXITSTATUS(system("./echo.com aaa 2>&1")) == 0) {
|
if (WEXITSTATUS(system("./echo.com aaa 2>&1")) == 0) {
|
||||||
success = read(pipefd[0], buf, sizeof(buf)-1) == (sizeof(buf)-1);
|
success = read(pipefd[0], buf, sizeof(buf) - 1) == (sizeof(buf) - 1);
|
||||||
}
|
}
|
||||||
ASSERT_NE(-1, dup2(stderrBack, 2));
|
ASSERT_NE(-1, dup2(stderrBack, 2));
|
||||||
ASSERT_EQ(true, success);
|
ASSERT_EQ(true, success);
|
||||||
|
@ -159,7 +159,7 @@ TEST(system, kill) {
|
||||||
TEST(system, exitStatusPreservedAfterSemiColon) {
|
TEST(system, exitStatusPreservedAfterSemiColon) {
|
||||||
ASSERT_EQ(1, WEXITSTATUS(system("false;")));
|
ASSERT_EQ(1, WEXITSTATUS(system("false;")));
|
||||||
ASSERT_EQ(1, WEXITSTATUS(system("false; ")));
|
ASSERT_EQ(1, WEXITSTATUS(system("false; ")));
|
||||||
if(!IsWindows() && !IsMetal()) {
|
if (!IsWindows() && !IsMetal()) {
|
||||||
ASSERT_EQ(1, WEXITSTATUS(system("/bin/false;")));
|
ASSERT_EQ(1, WEXITSTATUS(system("/bin/false;")));
|
||||||
ASSERT_EQ(1, WEXITSTATUS(system("/bin/false;")));
|
ASSERT_EQ(1, WEXITSTATUS(system("/bin/false;")));
|
||||||
}
|
}
|
||||||
|
@ -174,7 +174,7 @@ TEST(system, exitStatusPreservedAfterSemiColon) {
|
||||||
char buf[3] = {0};
|
char buf[3] = {0};
|
||||||
ASSERT_EQ(2, read(pipefd[0], buf, 2));
|
ASSERT_EQ(2, read(pipefd[0], buf, 2));
|
||||||
ASSERT_STREQ("1\n", buf);
|
ASSERT_STREQ("1\n", buf);
|
||||||
if(!IsWindows() && !IsMetal()) {
|
if (!IsWindows() && !IsMetal()) {
|
||||||
ASSERT_EQ(0, WEXITSTATUS(system("/bin/false; echo $?")));
|
ASSERT_EQ(0, WEXITSTATUS(system("/bin/false; echo $?")));
|
||||||
buf[0] = 0;
|
buf[0] = 0;
|
||||||
buf[1] = 0;
|
buf[1] = 0;
|
||||||
|
@ -196,7 +196,7 @@ TEST(system, allowsLoneCloseCurlyBrace) {
|
||||||
char buf[6] = {0};
|
char buf[6] = {0};
|
||||||
|
|
||||||
ASSERT_EQ(0, WEXITSTATUS(system("echo \"aaa\"}")));
|
ASSERT_EQ(0, WEXITSTATUS(system("echo \"aaa\"}")));
|
||||||
ASSERT_EQ(sizeof(buf)-1, read(pipefd[0], buf, sizeof(buf)-1));
|
ASSERT_EQ(sizeof(buf) - 1, read(pipefd[0], buf, sizeof(buf) - 1));
|
||||||
ASSERT_STREQ("aaa}\n", buf);
|
ASSERT_STREQ("aaa}\n", buf);
|
||||||
buf[0] = 0;
|
buf[0] = 0;
|
||||||
buf[1] = 0;
|
buf[1] = 0;
|
||||||
|
@ -205,7 +205,7 @@ TEST(system, allowsLoneCloseCurlyBrace) {
|
||||||
buf[4] = 0;
|
buf[4] = 0;
|
||||||
testlib_extract("/zip/echo.com", "echo.com", 0755);
|
testlib_extract("/zip/echo.com", "echo.com", 0755);
|
||||||
ASSERT_EQ(0, WEXITSTATUS(system("./echo.com \"aaa\"}")));
|
ASSERT_EQ(0, WEXITSTATUS(system("./echo.com \"aaa\"}")));
|
||||||
ASSERT_EQ(sizeof(buf)-1, read(pipefd[0], buf, sizeof(buf)-1));
|
ASSERT_EQ(sizeof(buf) - 1, read(pipefd[0], buf, sizeof(buf) - 1));
|
||||||
ASSERT_STREQ("aaa}\n", buf);
|
ASSERT_STREQ("aaa}\n", buf);
|
||||||
|
|
||||||
ASSERT_NE(-1, dup2(stdoutBack, 1));
|
ASSERT_NE(-1, dup2(stdoutBack, 1));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue