We should use EXPECT_EQ() when comparing WTF::String objects so that we get pretty-printed difference output for both the expected result and actual results. This can help expedite the diagnosis of a regression. == Current Behavior == Suppose we change line <http://trac.webkit.org/browser/trunk/Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp?rev=216131#L337> to purposely cause an failure: EXPECT_TRUE(reference.left(1) == String::fromUTF8("Ca")); Then run-api-tests will emit the following output: Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp:337 Value of: reference.left(1) == String::fromUTF8("Ca") Actual: false Expected: true == Proposed Behavior == Suppose we change the same line to purposely failure and use EXPECT_EQ(): EXPECT_EQ(String::fromUTF8("Ca"), reference.left(1)); Then run-api-tests will emit the following output: Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp:337 Value of: reference.left(1) Actual: C Expected: String::fromUTF8("Ca") Which is: Ca
(In reply to Daniel Bates from comment #0) > Suppose we change line > <http://trac.webkit.org/browser/trunk/Tools/TestWebKitAPI/Tests/WTF/ > WTFString.cpp?rev=216131#L337> to purposely cause an failure: The line should be <http://trac.webkit.org/browser/trunk/Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp?rev=216131#L336>
Created attachment 309111 [details] Patch
Committed r216255: <http://trac.webkit.org/changeset/216255>