Add %stderr and %stdout as recognized magic stream names

This commit is contained in:
Martin Hořeňovský
2022-03-07 10:42:26 +01:00
parent 61d0f7a9af
commit 06f74a0f8e
19 changed files with 194 additions and 19 deletions

View File

@@ -17,3 +17,12 @@ TEST_CASE( "Cout stream properly declares it writes to stdout", "[streams]" ) {
TEST_CASE( "Empty stream name opens cout stream", "[streams]" ) {
REQUIRE( Catch::makeStream( "" )->isStdout() );
}
TEST_CASE( "stdout and stderr streams have %-starting name", "[streams]" ) {
REQUIRE( Catch::makeStream( "%stderr" )->isStdout() );
REQUIRE( Catch::makeStream( "%stdout" )->isStdout() );
}
TEST_CASE( "request an unknown %-starting stream fails", "[streams]" ) {
REQUIRE_THROWS( Catch::makeStream( "%somestream" ) );
}