From a2bcc0025fdbd7647edaad6a7628fe10e25f4909 Mon Sep 17 00:00:00 2001 From: Mikhail Khorkov Date: Fri, 19 Aug 2022 12:37:08 +0700 Subject: [PATCH] Add tests for Supply.interval with :between option The tests is support for rakudo PR #5023 --- S17-supply/interval.t | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/S17-supply/interval.t b/S17-supply/interval.t index 8f0b29b1f9..8fa2dd4a7f 100644 --- a/S17-supply/interval.t +++ b/S17-supply/interval.t @@ -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'; @@ -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