Skip to content

Commit

Permalink
Update Replace String Literal With Raw String Literal tests
Browse files Browse the repository at this point in the history
  • Loading branch information
LegalizeAdulthood committed Jan 1, 2024
1 parent 2ceb3e4 commit 8367746
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 21 deletions.
4 changes: 2 additions & 2 deletions RefactorTest/ReplaceStringLiteralWithRawStringLiteral.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ std::string const path{"C:\\Program Files\\Vendor\\Application\\Application.exe"
std::string const contains_sentinel{"whoops)\""};

// #TEST#: RAW10
std::string const contains_delim{"whoops)\")delim\""};
std::string const contains_delim{"whoops)\")delimiter\""};

} // namespace

Expand All @@ -48,5 +48,5 @@ void TestReplaceStringLiteralWithRawStringLiteral()
REQUIRE_EQUAL(std::string("goink\\(one|two\\)\\\\\\?.*\\nfrob"), regex);
REQUIRE_EQUAL(std::string("C:\\Program Files\\Vendor\\Application\\Application.exe"), path);
REQUIRE_EQUAL(std::string("whoops)\""), contains_sentinel);
REQUIRE_EQUAL(std::string("whoops)\")delim\""), contains_delim);
REQUIRE_EQUAL(std::string("whoops)\")delimiter\""), contains_delim);
}
11 changes: 2 additions & 9 deletions results/diffs/RAW10.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
diff --git a/RefactorTest/ReplaceStringLiteralWithRawStringLiteral.cpp b/RefactorTest/ReplaceStringLiteralWithRawStringLiteral.cpp
index 19ce6b0..9e57c1b 100644
index 8d878a6..9e57c1b 100644
--- a/RefactorTest/ReplaceStringLiteralWithRawStringLiteral.cpp
+++ b/RefactorTest/ReplaceStringLiteralWithRawStringLiteral.cpp
@@ -33,7 +33,7 @@ std::string const path{"C:\\Program Files\\Vendor\\Application\\Application.exe"
std::string const contains_sentinel{"whoops)\""};

// #TEST#: RAW10
-std::string const contains_delim{"whoops)\")delim\""};
-std::string const contains_delim{"whoops)\")delimiter\""};
+std::string const contains_delim{R"delimiter2(whoops)")delimiter")delimiter2"};

} // namespace

@@ -48,5 +48,5 @@ void TestReplaceStringLiteralWithRawStringLiteral()
REQUIRE_EQUAL(std::string("goink\\(one|two\\)\\\\\\?.*\\nfrob"), regex);
REQUIRE_EQUAL(std::string("C:\\Program Files\\Vendor\\Application\\Application.exe"), path);
REQUIRE_EQUAL(std::string("whoops)\""), contains_sentinel);
- REQUIRE_EQUAL(std::string("whoops)\")delim\""), contains_delim);
+ REQUIRE_EQUAL(std::string("whoops)\")delimiter\""), contains_delim);
}
17 changes: 9 additions & 8 deletions results/diffs/RAW2.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
diff --git a/RefactorTest/ReplaceStringLiteralWithRawStringLiteral.cpp b/RefactorTest/ReplaceStringLiteralWithRawStringLiteral.cpp
index 19ce6b0..3cfda37 100644
index 19ce6b0..04b9f79 100644
--- a/RefactorTest/ReplaceStringLiteralWithRawStringLiteral.cpp
+++ b/RefactorTest/ReplaceStringLiteralWithRawStringLiteral.cpp
@@ -12,7 +12,7 @@ std::string const backslash{"goink\\frob"};
std::string const newline{"goink\nfrob"};
@@ -9,7 +9,8 @@ namespace
std::string const backslash{"goink\\frob"};

// #TEST#: RAW3
-std::string const tab{"goink\tfrob"};
+std::string const tab{R"(goink frob)"};
// #TEST#: RAW2
-std::string const newline{"goink\nfrob"};
+std::string const newline{R"(goink
+frob)"};

// #TEST#: RAW4
std::string const single_quote{"goink\'frob"};
// #TEST#: RAW3
std::string const tab{"goink\tfrob"};
4 changes: 2 additions & 2 deletions results/diffs/RAW9.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/RefactorTest/ReplaceStringLiteralWithRawStringLiteral.cpp b/RefactorTest/ReplaceStringLiteralWithRawStringLiteral.cpp
index 19ce6b0..47df928 100644
index 5cdf789..951d627 100644
--- a/RefactorTest/ReplaceStringLiteralWithRawStringLiteral.cpp
+++ b/RefactorTest/ReplaceStringLiteralWithRawStringLiteral.cpp
@@ -30,7 +30,7 @@ std::string const regex{"goink\\(one|two\\)\\\\\\?.*\\nfrob"};
Expand All @@ -10,4 +10,4 @@ index 19ce6b0..47df928 100644
+std::string const contains_sentinel{R"delimiter(whoops)")delimiter"};

// #TEST#: RAW10
std::string const contains_delim{"whoops)\")delim\""};
std::string const contains_delim{"whoops)\")delimiter\""};

0 comments on commit 8367746

Please sign in to comment.