From 7f8ef1ecc4004068f9178e932bdb0fa1c2b527d2 Mon Sep 17 00:00:00 2001 From: Alp Toker Date: Thu, 12 Dec 2013 03:31:20 +0000 Subject: [PATCH] Swap around EXPECT_EQ() arguments orders for more natural gtest Failure messages Somewhat counterintuitively the first arg in gtest is treated as the expectation. No change to the tests themselves. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197124 91177308-0d34-0410-b5e6-96231b3b80d8 --- unittests/Support/RegexTest.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/unittests/Support/RegexTest.cpp b/unittests/Support/RegexTest.cpp index abc8d0f38e0..30ea2c5b274 100644 --- a/unittests/Support/RegexTest.cpp +++ b/unittests/Support/RegexTest.cpp @@ -90,23 +90,23 @@ TEST_F(RegexTest, Substitution) { // Standard Escapes EXPECT_EQ("a\\ber", Regex("[0-9]+").sub("\\\\", "a1234ber", &Error)); - EXPECT_EQ(Error, ""); + EXPECT_EQ("", Error); EXPECT_EQ("a\nber", Regex("[0-9]+").sub("\\n", "a1234ber", &Error)); - EXPECT_EQ(Error, ""); + EXPECT_EQ("", Error); EXPECT_EQ("a\tber", Regex("[0-9]+").sub("\\t", "a1234ber", &Error)); - EXPECT_EQ(Error, ""); + EXPECT_EQ("", Error); EXPECT_EQ("ajber", Regex("[0-9]+").sub("\\j", "a1234ber", &Error)); - EXPECT_EQ(Error, ""); + EXPECT_EQ("", Error); EXPECT_EQ("aber", Regex("[0-9]+").sub("\\", "a1234ber", &Error)); EXPECT_EQ(Error, "replacement string contained trailing backslash"); // Backreferences EXPECT_EQ("aa1234bber", Regex("a[0-9]+b").sub("a\\0b", "a1234ber", &Error)); - EXPECT_EQ(Error, ""); + EXPECT_EQ("", Error); EXPECT_EQ("a1234ber", Regex("a([0-9]+)b").sub("a\\1b", "a1234ber", &Error)); - EXPECT_EQ(Error, ""); + EXPECT_EQ("", Error); EXPECT_EQ("aber", Regex("a[0-9]+b").sub("a\\100b", "a1234ber", &Error)); EXPECT_EQ(Error, "invalid backreference string '100'"); @@ -128,8 +128,8 @@ TEST_F(RegexTest, IsLiteralERE) { } TEST_F(RegexTest, Escape) { - EXPECT_EQ(Regex::escape("a[bc]"), "a\\[bc\\]"); - EXPECT_EQ(Regex::escape("abc{1\\,2}"), "abc\\{1\\\\,2\\}"); + EXPECT_EQ("a\\[bc\\]", Regex::escape("a[bc]")); + EXPECT_EQ("abc\\{1\\\\,2\\}", Regex::escape("abc{1\\,2}")); } TEST_F(RegexTest, IsValid) {