#include "StringUtils.h"
#include <catch2/catch.hpp>
Go to the source code of this file.
◆ TEST_CASE() [1/2]
TEST_CASE |
( |
"IsPrefixed" |
, |
|
|
"" |
[StringUtils] |
|
) |
| |
Definition at line 31 of file StringUtilsTests.cpp.
32{
33 SECTION("Empty prefix")
34 {
36 }
37
38 SECTION("Empty string")
39 {
41 }
42
43 SECTION("Prefix longer than string")
44 {
46 }
47
48 SECTION("Prefix is not a prefix")
49 {
51 }
52
53 SECTION("Prefix is a prefix")
54 {
56 }
57
58 SECTION("Prefix matches string")
59 {
61 }
62
63 SECTION("Case insensitive")
64 {
66 }
67}
bool IsPrefixedInsensitive(const HayType &hay, const PrefixType &prefix)
bool IsPrefixed(const HayType &hay, const PrefixType &prefix)
References IsPrefixed(), and IsPrefixedInsensitive().
◆ TEST_CASE() [2/2]
TEST_CASE |
( |
"Join" |
, |
|
|
"" |
[StringUtils] |
|
) |
| |
Definition at line 10 of file StringUtilsTests.cpp.
11{
12 SECTION("Join empty container")
13 {
14 std::vector<std::string> container;
15 REQUIRE(
Join(container,
",") ==
"");
16 }
17
18 SECTION("Join single item")
19 {
20 std::vector<std::string> container { "item" };
21 REQUIRE(
Join(container,
",") ==
"item");
22 }
23
24 SECTION("Join multiple items")
25 {
26 std::vector<std::string> container { "item1", "item2", "item3" };
27 REQUIRE(
Join(container,
",") ==
"item1,item2,item3");
28 }
29}
ResultType Join(const ContainerType< ResultType, Rest... > &container, const SeparatorType &separator)
References Join().