Skip to content

Commit 5920766

Browse files
committed
Added more test cases
1 parent a54a21d commit 5920766

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

test/source/subprocess_test.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ TEST_CASE("_cmd literal + string chaining")
6060
CHECK_EQ(errc, 0);
6161
}
6262

63-
TEST_CASE("bash-like redirection")
63+
TEST_CASE("bash-like redirection - stderr to stdout")
6464
{
6565
using namespace subprocess::literals;
6666
std::string output;
@@ -70,6 +70,15 @@ TEST_CASE("bash-like redirection")
7070
REQUIRE(not output.empty());
7171
}
7272

73+
TEST_CASE("bash-like redirection - stdout to stderr")
74+
{
75+
using namespace subprocess::literals;
76+
std::string output;
77+
int errc = ("echo abc"_cmd >= output > subprocess::err).run(std::nothrow);
78+
REQUIRE_EQ(errc, 0);
79+
REQUIRE(output == "abc\n");
80+
}
81+
7382
TEST_CASE("SIGPIPE handling for child processes")
7483
{
7584
using namespace subprocess::literals;

0 commit comments

Comments
 (0)