summaryrefslogtreecommitdiffstats
path: root/test/gtest_output_test_.cc
diff options
context:
space:
mode:
authorkosak <kosak@google.com>2014-07-28 21:54:50 (GMT)
committerkosak <kosak@google.com>2014-07-28 21:54:50 (GMT)
commitb54098a9abade957ab3c4e94ae5e5225ef0015a4 (patch)
treed7f6147ac30be588eebffb3c114bf9986221a8d4 /test/gtest_output_test_.cc
parentbd263344f9e930ab7d3558c1b7706a55739737cb (diff)
downloadgoogletest-b54098a9abade957ab3c4e94ae5e5225ef0015a4.zip
googletest-b54098a9abade957ab3c4e94ae5e5225ef0015a4.tar.gz
googletest-b54098a9abade957ab3c4e94ae5e5225ef0015a4.tar.bz2
Expand equality failure messages with a by-line diff.
Diffstat (limited to 'test/gtest_output_test_.cc')
-rw-r--r--test/gtest_output_test_.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/gtest_output_test_.cc b/test/gtest_output_test_.cc
index 07ab633..5361d8d 100644
--- a/test/gtest_output_test_.cc
+++ b/test/gtest_output_test_.cc
@@ -113,6 +113,11 @@ TEST(NonfatalFailureTest, EscapesStringOperands) {
EXPECT_EQ(golden, actual);
}
+TEST(NonfatalFailureTest, DiffForLongStrings) {
+ std::string golden_str(kGoldenString, sizeof(kGoldenString) - 1);
+ EXPECT_EQ(golden_str, "Line 2");
+}
+
// Tests catching a fatal failure in a subroutine.
TEST(FatalFailureTest, FatalFailureInSubroutine) {
printf("(expecting a failure that x should be 1)\n");