Skip to content
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