aboutsummaryrefslogtreecommitdiff
path: root/log_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'log_test.cc')
-rw-r--r--log_test.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/log_test.cc b/log_test.cc
index 0ceb3f2..c06fd90 100644
--- a/log_test.cc
+++ b/log_test.cc
@@ -80,5 +80,17 @@ TEST(LogTest, DedicatedErrorFunction) {
EXPECT_THAT(s.str(), HasSubstr("error:"));
}
+TEST(LogTest, CheckPasses) {
+ std::ostringstream s;
+ Log log("program", s);
+ CHECK(log, 2 + 2 == 4);
+ EXPECT_THAT(s.str(), IsEmpty());
+}
+
+TEST(LogDeathTest, CheckFails) {
+ Log log("program", std::cerr);
+ EXPECT_DEATH(CHECK(log, 2 + 2 == 5), "internal error \\(.*\\): 2 \\+ 2 == 5");
+}
+
} // namespace
} // namespace gsrsup