Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for Supply.interval with :between option #817

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion S17-supply/interval.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use lib $?FILE.IO.parent(2).add("packages/Test-Helpers");
use Test::Tap;
use Test::Util;

plan 9;
plan 11;

dies-ok { Supplier.new.Supply.interval(1) }, 'can not be called as an instance method';

Expand Down Expand Up @@ -73,4 +73,23 @@ is_run(
is-deeply @a, [0..5], "Timer with very short interval fires multiple times";
}

{
tap-ok Supply.interval(1, :between),
[^3],
'interval of 1 second between taps',
:emit({ sleep 1 }),
:after-tap({ sleep 5.1 }),
:virtual-time;
}

{
tap-ok Supply.interval(1, :between).share,
[1..2],
'interval of 1 second between share taps',
:live,
:emit({ sleep 1 }),
:after-tap({ sleep 5.1 }),
:virtual-time;
}

# vim: expandtab shiftwidth=4