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
6476b9ac
Commit
6476b9ac
authored
Nov 21, 2020
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix checks in string_view tests, close #1172
parent
9c2a7c66
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
+15
-7
libcaf_core/test/string_view.cpp
libcaf_core/test/string_view.cpp
+15
-7
No files found.
libcaf_core/test/string_view.cpp
View file @
6476b9ac
...
...
@@ -56,14 +56,22 @@ CAF_TEST(string conversion) {
}
CAF_TEST
(
substrings
)
{
auto
without_prefix
=
[](
string_view
str
,
size_t
n
)
{
str
.
remove_prefix
(
n
);
return
str
;
};
auto
without_suffix
=
[](
string_view
str
,
size_t
n
)
{
str
.
remove_suffix
(
n
);
return
str
;
};
auto
x
=
"abcdefghi"
_sv
;
CAF_CHECK
(
x
.
remove_prefix
(
3
),
"defghi"
);
CAF_CHECK
(
x
.
remove_suffix
(
3
),
"abcdef"
);
CAF_CHECK
(
x
.
substr
(
3
,
3
),
"def"
);
CAF_CHECK
(
x
.
remove_prefix
(
9
),
""
);
CAF_CHECK
(
x
.
remove_suffix
(
9
),
""
);
CAF_CHECK
(
x
.
substr
(
9
),
""
);
CAF_CHECK
(
x
.
substr
(
0
,
0
),
""
);
CAF_CHECK
_EQUAL
(
without_prefix
(
x
,
3
),
"defghi"
);
CAF_CHECK
_EQUAL
(
without_suffix
(
x
,
3
),
"abcdef"
);
CAF_CHECK
_EQUAL
(
x
.
substr
(
3
,
3
),
"def"
);
CAF_CHECK
_EQUAL
(
without_prefix
(
x
,
9
),
""
);
CAF_CHECK
_EQUAL
(
without_suffix
(
x
,
9
),
""
);
CAF_CHECK
_EQUAL
(
x
.
substr
(
9
),
""
);
CAF_CHECK
_EQUAL
(
x
.
substr
(
0
,
0
),
""
);
}
CAF_TEST
(
compare
)
{
...
...
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