mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-26 04:34:41 +00:00
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
This commit is contained in:
parent
22e0e0c1de
commit
7f8ef1ecc4
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user