Skip to content

Commit

Permalink
improve tests
Browse files Browse the repository at this point in the history
  • Loading branch information
agauniyal committed Sep 3, 2016
1 parent 9bfa006 commit c1bba4d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions test/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,22 @@ TEST_CASE("Rang printing to non-terminals", "[file]")
REQUIRE(s == output);
}
}

TEST_CASE("Rang printing to standard output", "[terminal]")
{
std::string s = "Rang works with ";

SECTION("output is to terminal")
{

std::cout << rang::fg::green << s << "std::cout" << rang::style::reset
<< std::endl;

std::clog << rang::fg::blue << s << "std::clog" << rang::style::reset
<< std::endl;

std::cerr << rang::fg::red << s << "std::cerr" << rang::style::reset
<< std::endl;
REQUIRE(1 == 1);
}
}
2 changes: 1 addition & 1 deletion test/visualTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ int main()
{
std::cout << std::endl
<< rang::style::reset << rang::bg::green << rang::fg::gray
<< "If you're seeing green bg, then rang works!"
<< "If you're seeing green background, then rang works!"
<< rang::style::reset << std::endl;
return 0;
}

0 comments on commit c1bba4d

Please sign in to comment.