Skip to content

Commit

Permalink
Added more test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
rajatjain1997 committed Sep 21, 2021
1 parent a54a21d commit 5920766
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/source/subprocess_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ TEST_CASE("_cmd literal + string chaining")
CHECK_EQ(errc, 0);
}

TEST_CASE("bash-like redirection")
TEST_CASE("bash-like redirection - stderr to stdout")
{
using namespace subprocess::literals;
std::string output;
Expand All @@ -70,6 +70,15 @@ TEST_CASE("bash-like redirection")
REQUIRE(not output.empty());
}

TEST_CASE("bash-like redirection - stdout to stderr")
{
using namespace subprocess::literals;
std::string output;
int errc = ("echo abc"_cmd >= output > subprocess::err).run(std::nothrow);
REQUIRE_EQ(errc, 0);
REQUIRE(output == "abc\n");
}

TEST_CASE("SIGPIPE handling for child processes")
{
using namespace subprocess::literals;
Expand Down

0 comments on commit 5920766

Please sign in to comment.