Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
567d25da
Commit
567d25da
authored
Nov 21, 2018
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove dead code and test more corner cases
parent
f4c8e986
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
15 deletions
+4
-15
libcaf_core/test/string_algorithms.cpp
libcaf_core/test/string_algorithms.cpp
+4
-15
No files found.
libcaf_core/test/string_algorithms.cpp
View file @
567d25da
...
@@ -29,10 +29,6 @@ using namespace caf;
...
@@ -29,10 +29,6 @@ using namespace caf;
namespace
{
namespace
{
struct
fixture
{
};
using
str_list
=
std
::
vector
<
std
::
string
>
;
using
str_list
=
std
::
vector
<
std
::
string
>
;
str_list
split
(
string_view
str
)
{
str_list
split
(
string_view
str
)
{
...
@@ -51,17 +47,8 @@ std::string join(str_list vec) {
...
@@ -51,17 +47,8 @@ std::string join(str_list vec) {
return
caf
::
join
(
vec
,
","
);
return
caf
::
join
(
vec
,
","
);
}
}
template
<
class
...
Ts
>
std
::
string
splice
(
string_view
glue
,
const
Ts
&
...
xs
)
{
std
::
string
result
;
caf
::
splice
(
result
,
glue
,
xs
...);
return
result
;
}
}
// namespace <anonymous>
}
// namespace <anonymous>
CAF_TEST_FIXTURE_SCOPE
(
string_algorithms_tests
,
fixture
)
CAF_TEST
(
splitting
)
{
CAF_TEST
(
splitting
)
{
CAF_CHECK_EQUAL
(
split
(
""
),
str_list
({
""
}));
CAF_CHECK_EQUAL
(
split
(
""
),
str_list
({
""
}));
CAF_CHECK_EQUAL
(
split
(
","
),
str_list
({
""
,
""
}));
CAF_CHECK_EQUAL
(
split
(
","
),
str_list
({
""
,
""
}));
...
@@ -96,6 +83,8 @@ CAF_TEST(starts with) {
...
@@ -96,6 +83,8 @@ CAF_TEST(starts with) {
CAF_CHECK
(
starts_with
(
"foobar"
,
"fooba"
));
CAF_CHECK
(
starts_with
(
"foobar"
,
"fooba"
));
CAF_CHECK
(
starts_with
(
"foobar"
,
"foobar"
));
CAF_CHECK
(
starts_with
(
"foobar"
,
"foobar"
));
CAF_CHECK
(
!
starts_with
(
"foobar"
,
"o"
));
CAF_CHECK
(
!
starts_with
(
"foobar"
,
"o"
));
CAF_CHECK
(
!
starts_with
(
"foobar"
,
"fa"
));
CAF_CHECK
(
!
starts_with
(
"foobar"
,
"foobaro"
));
}
}
CAF_TEST
(
ends
with
)
{
CAF_TEST
(
ends
with
)
{
...
@@ -104,6 +93,6 @@ CAF_TEST(ends with) {
...
@@ -104,6 +93,6 @@ CAF_TEST(ends with) {
CAF_CHECK
(
ends_with
(
"foobar"
,
"oobar"
));
CAF_CHECK
(
ends_with
(
"foobar"
,
"oobar"
));
CAF_CHECK
(
ends_with
(
"foobar"
,
"foobar"
));
CAF_CHECK
(
ends_with
(
"foobar"
,
"foobar"
));
CAF_CHECK
(
!
ends_with
(
"foobar"
,
"a"
));
CAF_CHECK
(
!
ends_with
(
"foobar"
,
"a"
));
CAF_CHECK
(
!
ends_with
(
"foobar"
,
"car"
));
CAF_CHECK
(
!
ends_with
(
"foobar"
,
"afoobar"
));
}
}
CAF_TEST_FIXTURE_SCOPE_END
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment