diff options
| author | Leonetienne <leonetienne@hotmail.de> | 2022-02-12 03:07:11 +0100 |
|---|---|---|
| committer | Leonetienne <leonetienne@hotmail.de> | 2022-02-12 03:07:11 +0100 |
| commit | a6c9e64eb559a58d31f5ea68b8947f460ed8f04b (patch) | |
| tree | 0e5789541a3d26e4c0c1bed8a0585be27fc182ec /StringTools/Test/Replace_Char.cpp | |
| parent | f4e36ec9af5002eaa51c742faa10e4cbc7d66de0 (diff) | |
Better directory structure naming
Diffstat (limited to 'StringTools/Test/Replace_Char.cpp')
| -rw-r--r-- | StringTools/Test/Replace_Char.cpp | 156 |
1 files changed, 0 insertions, 156 deletions
diff --git a/StringTools/Test/Replace_Char.cpp b/StringTools/Test/Replace_Char.cpp deleted file mode 100644 index a880e59..0000000 --- a/StringTools/Test/Replace_Char.cpp +++ /dev/null @@ -1,156 +0,0 @@ -#include <StringTools/StringTools.h>
-#include "Catch2.h"
-
-// Tests that replacing something in an empty string returns an empty string
-TEST_CASE(__FILE__"/EmptyString", "[ReplaceChar]")
-{
- // Setup
- const std::string in = "";
-
- // Exercise
- const std::string out = StringTools::Replace(in, 'a', "Subst");
-
- // Verify
- REQUIRE(out == "");
- return;
-}
-
-// Tests that replacing a char to an empty string works
-TEST_CASE(__FILE__"/Single_ReplaceToEmpty", "[ReplaceChar]")
-{
- // Setup
- const std::string in = "i";
-
- // Exercise
- const std::string out = StringTools::Replace(in, 'i', "");
-
- // Verify
- REQUIRE(out == "");
- return;
-}
-
-// Tests that replacing to a single char works
-TEST_CASE(__FILE__"/Single_ReplaceToSingleChar", "[ReplaceChar]")
-{
- // Setup
- const std::string in = "a";
-
- // Exercise
- const std::string out = StringTools::Replace(in, 'a', "i");
-
- // Verify
- REQUIRE(out == "i");
- return;
-}
-
-// Tests that replacing to a single char works, passing a char
-TEST_CASE(__FILE__"/Single_ReplaceToSingleChar_AsChar", "[ReplaceChar]")
-{
- // Setup
- const std::string in = "Oilbanger";
-
- // Exercise
- const std::string out = StringTools::Replace(in, 'a', 'i');
-
- // Verify
- REQUIRE(out == "Oilbinger");
- return;
-}
-
-// Tests that replacing the find to something longer works
-TEST_CASE(__FILE__"/Single_ReplaceToLonger", "[ReplaceChar]")
-{
- // Setup
- const std::string in = "Littled";
-
- // Exercise
- const std::string out = StringTools::Replace(in, 'd', "binger");
-
- // Verify
- REQUIRE(out == "Littlebinger");
- return;
-}
-
-// Tests that replacing a char to an empty string works
-TEST_CASE(__FILE__"/Multiple_ReplaceToEmpty", "[ReplaceChar]")
-{
- // Setup
- const std::string in = "dirty dogs dig dirt daringly";
-
- // Exercise
- const std::string out = StringTools::Replace(in, 'd', "");
-
- // Verify
- REQUIRE(out == "irty ogs ig irt aringly");
- return;
-}
-
-// Tests that replacing to a single char works
-TEST_CASE(__FILE__"/Multiple_ReplaceToSingleChar", "[ReplaceChar]")
-{
- // Setup
- const std::string in = "Oilbanger, Bangerfanger, Lattle brattle oaly skattle.";
-
- // Exercise
- const std::string out = StringTools::Replace(in, 'a', "i");
-
- // Verify
- REQUIRE(out == "Oilbinger, Bingerfinger, Little brittle oily skittle.");
- return;
-}
-
-// Tests that replacing to a single char works, passing a char
-TEST_CASE(__FILE__"/Multiple_ReplaceToSingleChar_AsChar", "[ReplaceChar]")
-{
- // Setup
- const std::string in = "Oilbanger, Bangerfanger, Lattle brattle oaly skattle.";
-
- // Exercise
- const std::string out = StringTools::Replace(in, 'a', 'i');
-
- // Verify
- REQUIRE(out == "Oilbinger, Bingerfinger, Little brittle oily skittle.");
- return;
-}
-
-// Tests that replacing the find to something longer works
-TEST_CASE(__FILE__"/Multiple_ReplaceToLonger", "[ReplaceChar]")
-{
- // Setup
- const std::string in = "d d d d d d d d";
-
- // Exercise
- const std::string out = StringTools::Replace(in, 'd', "bla");
-
- // Verify
- REQUIRE(out == "bla bla bla bla bla bla bla bla");
- return;
-}
-
-// Tests that the replacer ignores chars put in by the replacer
-TEST_CASE(__FILE__"/ReplacerIgnoresReplaced", "[ReplaceChar]")
-{
- // Setup
- const std::string in = "b b b b b b b b";
-
- // Exercise
- const std::string out = StringTools::Replace(in, 'b', "bla");
-
- // Verify
- REQUIRE(out == "bla bla bla bla bla bla bla bla");
- return;
-}
-
-// Tests that replacing succesive findings works
-TEST_CASE(__FILE__"/Replace_Successive", "[ReplaceChar]")
-{
- // Setup
- const std::string in = "bbbbbbbb";
-
- // Exercise
- const std::string out = StringTools::Replace(in, 'b', "bla");
-
- // Verify
- REQUIRE(out == "blablablablablablablabla");
- return;
-}
|
