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
6b2e3baf
Commit
6b2e3baf
authored
Nov 18, 2022
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve coverage of from_container tests
parent
5057e433
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletion
+16
-1
libcaf_core/test/flow/generation.cpp
libcaf_core/test/flow/generation.cpp
+16
-1
No files found.
libcaf_core/test/flow/generation.cpp
View file @
6b2e3baf
...
...
@@ -65,7 +65,9 @@ SCENARIO("container sources stream their input values") {
THEN
(
"the observer receives the values from the container in order"
)
{
auto
xs
=
ivec
{
1
,
2
,
3
,
4
,
5
,
6
,
7
};
auto
snk
=
flow
::
make_passive_observer
<
int
>
();
ctx
->
make_observable
().
from_container
(
xs
).
subscribe
(
snk
->
as_observer
());
ctx
->
make_observable
()
.
from_container
(
std
::
move
(
xs
))
.
subscribe
(
snk
->
as_observer
());
CHECK_EQ
(
snk
->
state
,
flow
::
observer_state
::
subscribed
);
CHECK
(
snk
->
buf
.
empty
());
if
(
CHECK
(
snk
->
sub
))
{
...
...
@@ -79,6 +81,19 @@ SCENARIO("container sources stream their input values") {
}
}
}
WHEN
(
"combining it with with a step that limits the amount of items"
)
{
THEN
(
"the observer receives the defined subset of values"
)
{
auto
xs
=
iota_vec
(
713
);
auto
snk
=
flow
::
make_passive_observer
<
int
>
();
auto
res
=
ivec
{};
ctx
->
make_observable
()
.
from_container
(
std
::
move
(
xs
))
.
take
(
678
)
.
for_each
([
&
res
](
int
val
)
{
res
.
push_back
(
val
);
});
ctx
->
run
();
CHECK_EQ
(
res
,
iota_vec
(
678
));
}
}
}
}
...
...
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