diff --git a/S17-supply/batch.t b/S17-supply/batch.t index e051295629..c1cef9a4c0 100644 --- a/S17-supply/batch.t +++ b/S17-supply/batch.t @@ -11,7 +11,7 @@ dies_ok { Supply.batch(1000) }, 'can not be called as a class method'; for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { diag "**** scheduling with {$*SCHEDULER.WHAT.perl}"; - tap_ok Supply.from-list(1..14).batch(:elems(5)), + tap-ok Supply.from-list(1..14).batch(:elems(5)), [[1..5],[6..10],[11..14]], "we can batch by number of elements"; @@ -21,7 +21,7 @@ for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { my $b = $s.batch( :$seconds ); sleep $seconds - now % $seconds; # wait until next $sleep second period my $base = time div $seconds; - tap_ok $b, + tap-ok $b, [[$base xx 10],[$base+1 xx 10]], "we can batch by time", :timeout(3 * $seconds), @@ -42,7 +42,7 @@ for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { my $b = $s.batch( :$elems, :$seconds ); sleep $seconds - now % $seconds; # wait until next $sleep second period my $base = time div $seconds; - tap_ok $b, + tap-ok $b, [[$base xx $elems],[$base xx $rest], [$base+1 xx $elems],[$base+1 xx $rest]], "we can batch by time and elems", @@ -59,6 +59,6 @@ for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { my $f = Supply.from-list(1..10); my $b = $f.batch(:elems(1)), ok $f === $b, "batch by 1 is a noop"; - tap_ok $b, [1..10], "noop batch"; + tap-ok $b, [1..10], "noop batch"; } } diff --git a/S17-supply/categorize.t b/S17-supply/categorize.t index ec97fdd341..ced96fd4de 100644 --- a/S17-supply/categorize.t +++ b/S17-supply/categorize.t @@ -33,8 +33,8 @@ for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { $s.emit($_) for 1,2,3,11,12,13; is_deeply @keys, [0,1], "did we get the right keys ($what)"; - tap_ok @supplies[0], [1,2,3], "got the 0 supply ($what)", :live; - tap_ok @supplies[1], [11,12,13], "got the 1 supply ($what)", :live; + tap-ok @supplies[0], [1,2,3], "got the 0 supply ($what)", :live; + tap-ok @supplies[1], [11,12,13], "got the 1 supply ($what)", :live; } } @@ -58,7 +58,7 @@ for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { $s.emit($_) for 1,2,3,11,12,13; is_deeply @keys, [0,1], "did we get the right keys ($what)"; - tap_ok @supplies[0], [11,12,13], "got the 0 supply ($what)", :live; + tap-ok @supplies[0], [11,12,13], "got the 0 supply ($what)", :live; my $done = False; @supplies[1].tap(done => sub { $done = True }); diff --git a/S17-supply/classify.t b/S17-supply/classify.t index 82b754503f..35aba788a7 100644 --- a/S17-supply/classify.t +++ b/S17-supply/classify.t @@ -32,7 +32,7 @@ for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { $s.emit($_) for 1,2,3,11,12,13; is_deeply @keys, [0,1], "did we get the right keys ($what)"; - tap_ok @supplies[0], [1,2,3], "got the 0 supply ($what)", :live; - tap_ok @supplies[1], [11,12,13], "got the 1 supply ($what)", :live; + tap-ok @supplies[0], [1,2,3], "got the 0 supply ($what)", :live; + tap-ok @supplies[1], [11,12,13], "got the 1 supply ($what)", :live; } } diff --git a/S17-supply/delayed.t b/S17-supply/delayed.t index 6e84fdd0fe..2ddf0f82fa 100644 --- a/S17-supply/delayed.t +++ b/S17-supply/delayed.t @@ -16,7 +16,7 @@ for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { my $delay = 2; my $now = now; my $seen; - tap_ok $now.Supply.delayed($delay), + tap-ok $now.Supply.delayed($delay), [$now], ".delay with on-demand Supply worked", :emit( { $seen = now } ), @@ -30,7 +30,7 @@ for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { my $s = Supply.new; my $now = now; my $seen; - tap_ok $s.delayed($delay), + tap-ok $s.delayed($delay), [$now], ".delay with live Supply worked", :live, @@ -48,6 +48,6 @@ for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { my $for = Supply.from-list(1..10); my $delay = $for.delayed(0); ok $for === $delay, "delaying by 0 is a noop"; - tap_ok $delay, [1..10], "noop delay"; + tap-ok $delay, [1..10], "noop delay"; } } diff --git a/S17-supply/do.t b/S17-supply/do.t index 3152eb2da5..8d9fca3a76 100644 --- a/S17-supply/do.t +++ b/S17-supply/do.t @@ -13,7 +13,7 @@ for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { { my $seen; - tap_ok Supply.from-list(1..10).do( {$seen++} ), + tap-ok Supply.from-list(1..10).do( {$seen++} ), [1..10], ".do worked"; is $seen, 10, "did the side effect work"; } diff --git a/S17-supply/elems.t b/S17-supply/elems.t index dfd7ef3bd4..daa60126c3 100644 --- a/S17-supply/elems.t +++ b/S17-supply/elems.t @@ -11,11 +11,11 @@ dies_ok { Supply.elems }, 'can not be called as a class method'; for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { diag "**** scheduling with {$*SCHEDULER.WHAT.perl}"; - tap_ok Supply.from-list(42..51).elems, [1..10], "just tracing elems works"; + tap-ok Supply.from-list(42..51).elems, [1..10], "just tracing elems works"; { my $s = Supply.new; - tap_ok $s.elems(1), + tap-ok $s.elems(1), [1,2,5], 'works in 1 second increments', # :live, diff --git a/S17-supply/flat.t b/S17-supply/flat.t index a239c876db..82ea2bf9fd 100644 --- a/S17-supply/flat.t +++ b/S17-supply/flat.t @@ -11,7 +11,7 @@ dies_ok { Supply.flat }, 'can not be called as a class method'; for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { diag "**** scheduling with {$*SCHEDULER.WHAT.perl}"; - tap_ok Supply.from-list( [1,2],[3,4,5] ).flat, + tap-ok Supply.from-list( [1,2],[3,4,5] ).flat, [1..5], "On demand publish with flat"; my $s = Supply.new; diff --git a/S17-supply/from-list.t b/S17-supply/from-list.t index 357dc59800..56b0d9d1b6 100644 --- a/S17-supply/from-list.t +++ b/S17-supply/from-list.t @@ -13,18 +13,18 @@ for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { { my $s = Supply.from-list(1..10); - tap_ok $s, [1..10], "On demand publish worked"; - tap_ok $s, [1..10], "Second tap gets all the values"; + tap-ok $s, [1..10], "On demand publish worked"; + tap-ok $s, [1..10], "Second tap gets all the values"; ok $s.Supply === $s, '.Supply on a Supply is a noop'; } - tap_ok (1..10).Supply, + tap-ok (1..10).Supply, [1..10], "Supply coercer worked on Range"; - tap_ok (1,2,3,4,5,6,7,8,9,10).Supply, + tap-ok (1,2,3,4,5,6,7,8,9,10).Supply, [1..10], "Supply coercer worked on Parcel"; - tap_ok "food".Supply, + tap-ok "food".Supply, [], "Supply coercer worked on scalar"; } diff --git a/S17-supply/grab.t b/S17-supply/grab.t index 2723bcb7a7..c4d32bb35e 100644 --- a/S17-supply/grab.t +++ b/S17-supply/grab.t @@ -11,6 +11,6 @@ dies_ok { Supply.grab }, 'can not be called as a class method'; for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { diag "**** scheduling with {$*SCHEDULER.WHAT.perl}"; - tap_ok Supply.from-list(1..10).grab( {.reverse} ), [10...1], "we can reverse"; - tap_ok Supply.from-list(1..10).grab( {[min] $_} ), [1], "we can find the min"; + tap-ok Supply.from-list(1..10).grab( {.reverse} ), [10...1], "we can reverse"; + tap-ok Supply.from-list(1..10).grab( {[min] $_} ), [1], "we can find the min"; } diff --git a/S17-supply/grep.t b/S17-supply/grep.t index c317c3a617..a7f9e40cc0 100644 --- a/S17-supply/grep.t +++ b/S17-supply/grep.t @@ -11,15 +11,15 @@ dies_ok { Supply.grep({...}) }, 'can not be called as a class method'; for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { diag "**** scheduling with {$*SCHEDULER.WHAT.perl}"; - tap_ok Supply.from-list(1..10).grep( * > 5 ), + tap-ok Supply.from-list(1..10).grep( * > 5 ), [6,7,8,9,10], "grepping taps with a Callable works"; - tap_ok Supply.from-list(1..10,"a".."z").grep(Int), + tap-ok Supply.from-list(1..10,"a".."z").grep(Int), [1..10], "grepping taps with a Type works"; - tap_ok Supply.from-list("a".."z").grep(/<[a..e]>/), + tap-ok Supply.from-list("a".."z").grep(/<[a..e]>/), ["a".."e"], "grepping taps with a Regex works"; } diff --git a/S17-supply/interval.t b/S17-supply/interval.t index d354cab733..cbca5b8a57 100644 --- a/S17-supply/interval.t +++ b/S17-supply/interval.t @@ -9,14 +9,14 @@ plan 3; dies_ok { Supply.new.interval(1) }, 'can not be called as an instance method'; { - tap_ok Supply.interval(1), + tap-ok Supply.interval(1), [^5], 'interval of 1 second', :after-tap( { sleep 4.5 } ); } { - tap_ok Supply.interval(1, 2), + tap-ok Supply.interval(1, 2), [^3], 'interval of 1 second with delay of 2', :after-tap( { sleep 4.5 } ); diff --git a/S17-supply/last.t b/S17-supply/last.t index 9d19e4bb92..d61a52beec 100644 --- a/S17-supply/last.t +++ b/S17-supply/last.t @@ -14,7 +14,7 @@ dies_ok { Supply.new.last("foo") }, 'cannot have "foo" last'; for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { diag "**** scheduling with {$*SCHEDULER.WHAT.perl}"; - tap_ok Supply.from-list(1..10).last, [10], "the last one works"; - tap_ok Supply.from-list(1..10).last(5), [6..10], "the last five works"; - tap_ok Supply.from-list(1..10).last(15), [1..10], "the last 15 works"; + tap-ok Supply.from-list(1..10).last, [10], "the last one works"; + tap-ok Supply.from-list(1..10).last(5), [6..10], "the last five works"; + tap-ok Supply.from-list(1..10).last(15), [1..10], "the last 15 works"; } diff --git a/S17-supply/lines.t b/S17-supply/lines.t index 08a019556b..ba761df5e4 100644 --- a/S17-supply/lines.t +++ b/S17-supply/lines.t @@ -15,37 +15,37 @@ dies_ok { Supply.lines }, 'can not be called as a class method'; for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { diag "**** scheduling with {$*SCHEDULER.WHAT.perl}"; - tap_ok Supply.from-list( @simple.map: * ~ "\n" ).lines, + tap-ok Supply.from-list( @simple.map: * ~ "\n" ).lines, @simple, "handle a simple list of lines with LF"; - tap_ok Supply.from-list( @original = @simple.map: * ~ "\n" ).lines(:!chomp), + tap-ok Supply.from-list( @original = @simple.map: * ~ "\n" ).lines(:!chomp), @original, "handle a simple list of lines with LF without chomping"; - tap_ok Supply.from-list( @simple.map: * ~ "\r" ).lines, + tap-ok Supply.from-list( @simple.map: * ~ "\r" ).lines, @simple, "handle a simple list of lines with CR"; - tap_ok Supply.from-list( @original = @simple.map: * ~ "\r" ).lines(:!chomp), + tap-ok Supply.from-list( @original = @simple.map: * ~ "\r" ).lines(:!chomp), @original, "handle a simple list of lines with CR without chomping"; - tap_ok Supply.from-list( @simple.map: * ~ "\r\n" ).lines, + tap-ok Supply.from-list( @simple.map: * ~ "\r\n" ).lines, @simple, "handle a simple list of lines with CRLF"; - tap_ok Supply.from-list( @original = @simple.map: * ~ "\r\n" ).lines(:!chomp), + tap-ok Supply.from-list( @original = @simple.map: * ~ "\r\n" ).lines(:!chomp), @original, "handle a simple list of lines with CRLF without chomping"; - tap_ok Supply.from-list( @simple.map: * ~ @endings.pick ).lines, + tap-ok Supply.from-list( @simple.map: * ~ @endings.pick ).lines, @simple, "handle a simple list of lines with mixed line ending"; - tap_ok Supply.from-list(@original= @simple.map: * ~ @endings.pick).lines(:!chomp), + tap-ok Supply.from-list(@original= @simple.map: * ~ @endings.pick).lines(:!chomp), @original, "handle a simple list of lines with mixed line ending w/o chomping"; { my $s = Supply.new; - tap_ok $s.lines, + tap-ok $s.lines, [, '', 'eeee'], "handle chunked lines", :after-tap( { @@ -59,7 +59,7 @@ for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { { my $s = Supply.new; - tap_ok $s.lines(:!chomp), + tap-ok $s.lines(:!chomp), ["a\n","b\r\n","c\r","d\n","\n","eeee"], "handle chunked lines", :after-tap( { diff --git a/S17-supply/map.t b/S17-supply/map.t index 3e826f9bcd..8aff6bb686 100644 --- a/S17-supply/map.t +++ b/S17-supply/map.t @@ -11,17 +11,17 @@ dies_ok { Supply.map({...}) }, 'can not be called as a class method'; for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { diag "**** scheduling with {$*SCHEDULER.WHAT.perl}"; - tap_ok Supply.from-list( (1..5).map( {[$_]} ) ), + tap-ok Supply.from-list( (1..5).map( {[$_]} ) ), [[1],[2],[3],[4],[5]], "On demand publish with arrays"; - tap_ok Supply.from-list( [1,2],[3,4,5] ).map( {.flat} ), + tap-ok Supply.from-list( [1,2],[3,4,5] ).map( {.flat} ), [1..5], "On demand publish with flattened arrays"; - tap_ok Supply.from-list(1..10).map( * * 5 ), + tap-ok Supply.from-list(1..10).map( * * 5 ), [5,10,15,20,25,30,35,40,45,50], "mapping tap with single values works"; - tap_ok Supply.from-list(1..10).map( { $_ xx 2 } ), + tap-ok Supply.from-list(1..10).map( { $_ xx 2 } ), [1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10], "mapping tap with multiple values works"; } diff --git a/S17-supply/max.t b/S17-supply/max.t index be230e4437..436a10af91 100644 --- a/S17-supply/max.t +++ b/S17-supply/max.t @@ -12,12 +12,12 @@ dies_ok { Supply.new.max(23) }, 'must be code if specified'; for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { diag "**** scheduling with {$*SCHEDULER.WHAT.perl}"; - tap_ok Supply.from-list(1..10).max, [1..10], + tap-ok Supply.from-list(1..10).max, [1..10], "ascending max works"; - tap_ok Supply.from-list(10...1).max, [10], + tap-ok Supply.from-list(10...1).max, [10], "descending max works"; - tap_ok Supply.from-list("a".."e","A".."E").max(*.uc), [], + tap-ok Supply.from-list("a".."e","A".."E").max(*.uc), [], "ascending alpha works"; - tap_ok Supply.from-list("E"..."A","e".."a").max(*.lc), ["E"], + tap-ok Supply.from-list("E"..."A","e".."a").max(*.lc), ["E"], "descending alpha works"; } diff --git a/S17-supply/merge.t b/S17-supply/merge.t index cd1d71cacf..1bbe2292ae 100644 --- a/S17-supply/merge.t +++ b/S17-supply/merge.t @@ -12,7 +12,7 @@ for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { { my $s1 = Supply.new; my $s2 = Supply.new; - tap_ok $s1.merge($s2), + tap-ok $s1.merge($s2), [1,2,'a',3,'b'], "merging supplies works", :after-tap( { @@ -26,7 +26,7 @@ for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { } ); } - tap_ok Supply.merge( + tap-ok Supply.merge( Supply.from-list(1..5), Supply.from-list(6..10), Supply.from-list(11..15) ), [1..15], "merging 3 supplies works", :sort; @@ -35,7 +35,7 @@ for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { my $s = Supply.from-list(1..10); my $m = Supply.merge($s); ok $s === $m, "merging one supply is a noop"; - tap_ok $m, [1..10], "noop merge"; + tap-ok $m, [1..10], "noop merge"; } throws_like( { Supply.merge(42) }, diff --git a/S17-supply/min.t b/S17-supply/min.t index 17ee429be8..d08b7b3529 100644 --- a/S17-supply/min.t +++ b/S17-supply/min.t @@ -12,12 +12,12 @@ dies_ok { Supply.new.min(23) }, 'must be code if specified'; for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { diag "**** scheduling with {$*SCHEDULER.WHAT.perl}"; - tap_ok Supply.from-list(1..10).min, [1], + tap-ok Supply.from-list(1..10).min, [1], "ascending min works"; - tap_ok Supply.from-list(10...1).min, [10...1], + tap-ok Supply.from-list(10...1).min, [10...1], "descending min works"; - tap_ok Supply.from-list("a".."e","A".."E").min(*.uc), ["a"], + tap-ok Supply.from-list("a".."e","A".."E").min(*.uc), ["a"], "ascending alpha works"; - tap_ok Supply.from-list("E"..."A","e".."a").min(*.lc), [], + tap-ok Supply.from-list("E"..."A","e".."a").min(*.lc), [], "descending alpha works"; } diff --git a/S17-supply/minmax.t b/S17-supply/minmax.t index 2bd2c40302..08fd3aec92 100644 --- a/S17-supply/minmax.t +++ b/S17-supply/minmax.t @@ -12,14 +12,14 @@ dies_ok { Supply.new.minmax(23) }, 'must be code if specified'; for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { diag "**** scheduling with {$*SCHEDULER.WHAT.perl}"; - tap_ok Supply.from-list(1..5).minmax, [(1..1),(1..2),(1..3),(1..4),(1..5)], + tap-ok Supply.from-list(1..5).minmax, [(1..1),(1..2),(1..3),(1..4),(1..5)], "ascending minmax works"; - tap_ok Supply.from-list(5...1).minmax, [(5..5),(4..5),(3..5),(2..5),(1..5)], + tap-ok Supply.from-list(5...1).minmax, [(5..5),(4..5),(3..5),(2..5),(1..5)], "descending minmax works"; - tap_ok Supply.from-list("a".."e","A".."E").minmax(*.uc), + tap-ok Supply.from-list("a".."e","A".."E").minmax(*.uc), [("a".."a"),("a".."b"),("a".."c"),("a".."d"),("a".."e")], "ascending alpha works"; - tap_ok Supply.from-list("E"..."A","e".."a").minmax(*.lc), + tap-ok Supply.from-list("E"..."A","e".."a").minmax(*.lc), [("E".."E"),("D".."E"),("C".."E"),("B".."E"),("A".."E")], "descending alpha works"; } diff --git a/S17-supply/on-demand.t b/S17-supply/on-demand.t index f080eeffde..fe8164a89d 100644 --- a/S17-supply/on-demand.t +++ b/S17-supply/on-demand.t @@ -13,8 +13,8 @@ for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { { my $s = Supply.on-demand( -> \s { s.emit($_) for 1..10; s.done } ); - tap_ok $s, [1..10], :!live, "On demand publish worked"; - tap_ok $s, [1..10], :!live, "Second tap gets all the values"; + tap-ok $s, [1..10], :!live, "On demand publish worked"; + tap-ok $s, [1..10], :!live, "Second tap gets all the values"; ok $s.Supply === $s, '.Supply on a Supply is a noop'; } diff --git a/S17-supply/on.t b/S17-supply/on.t index 4e32801ba4..9376540f58 100644 --- a/S17-supply/on.t +++ b/S17-supply/on.t @@ -16,7 +16,7 @@ for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { $res.emit($val); } } - tap_ok $on, [1..10], "minimal 'on' works"; + tap-ok $on, [1..10], "minimal 'on' works"; } { @@ -38,7 +38,7 @@ for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { } } } - tap_ok $on, + tap-ok $on, [:a(1),:b(2),:c(3),:d(4),:e(5),:f(6),:g(7),:h(8),:i(9),:j(10)], "basic 2 supply 'on' works"; } @@ -55,7 +55,7 @@ for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { } } } - tap_ok $on, + tap-ok $on, [,,,,], "basic 2 supply with (a,b) 'on' works"; } @@ -72,7 +72,7 @@ for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { } } } - tap_ok $on, + tap-ok $on, [,,,,], "basic 3 supply with array 'on' works"; } @@ -87,6 +87,6 @@ for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { done => { $res.done if ++$done == +@s } } } - tap_ok $on, @seen, "basic 2 supply with array without index 'on' works"; + tap-ok $on, @seen, "basic 2 supply with array without index 'on' works"; } } diff --git a/S17-supply/reduce.t b/S17-supply/reduce.t index a8f175563f..0b5eef5688 100644 --- a/S17-supply/reduce.t +++ b/S17-supply/reduce.t @@ -12,17 +12,17 @@ dies_ok { Supply.new.reduce(23) }, 'must be code if specified'; for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { diag "**** scheduling with {$*SCHEDULER.WHAT.perl}"; - tap_ok Supply.from-list(1..5).reduce( {$^a + $^b} ), [1,3,6,10,15], + tap-ok Supply.from-list(1..5).reduce( {$^a + $^b} ), [1,3,6,10,15], "simple reduce works"; - tap_ok Supply.from-list(42).reduce( {$^a * $^b} ), [42], + tap-ok Supply.from-list(42).reduce( {$^a * $^b} ), [42], "minimal reduce works"; - tap_ok Supply.from-list("a".."e").reduce(&infix:<~>), + tap-ok Supply.from-list("a".."e").reduce(&infix:<~>), [], "reducing with concatenate works"; { my $s = Supply.new; - tap_ok $s.reduce( &infix:<(+)> ), + tap-ok $s.reduce( &infix:<(+)> ), [ {a => 1, b => 2}, (a => 1, b => 4, c => 42).Bag, diff --git a/S17-supply/reverse.t b/S17-supply/reverse.t index 7eaca2e12b..426543e238 100644 --- a/S17-supply/reverse.t +++ b/S17-supply/reverse.t @@ -11,5 +11,5 @@ dies_ok { Supply.reverse }, 'can not be called as a class method'; for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { diag "**** scheduling with {$*SCHEDULER.WHAT.perl}"; - tap_ok Supply.from-list(1..10).reverse, [10...1], "we can reverse"; + tap-ok Supply.from-list(1..10).reverse, [10...1], "we can reverse"; } diff --git a/S17-supply/rotor.t b/S17-supply/rotor.t index 02ea78623a..c029de62f7 100644 --- a/S17-supply/rotor.t +++ b/S17-supply/rotor.t @@ -13,39 +13,39 @@ dies_ok { Supply.from-list(1..5).rotor }, 'no param version illegal'; for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { diag "**** scheduling with {$*SCHEDULER.WHAT.perl}"; - tap_ok Supply.from-list(1..5).rotor(3 => -2), + tap-ok Supply.from-list(1..5).rotor(3 => -2), [[1,2,3],[2,3,4],[3,4,5]], "we can rotor with negative gap and overlap"; - tap_ok Supply.from-list(1..5).rotor(3 => -2,:!partial), + tap-ok Supply.from-list(1..5).rotor(3 => -2,:!partial), [[1,2,3],[2,3,4],[3,4,5]], "we can rotor with negative gap and overlap without partial"; - tap_ok Supply.from-list(1..5).rotor(3 => -2,:partial), + tap-ok Supply.from-list(1..5).rotor(3 => -2,:partial), [[1,2,3],[2,3,4],[3,4,5],[4,5]], "we can rotor with negative gap and overlap with partial"; - tap_ok Supply.from-list(1..10).rotor(3 => 0), + tap-ok Supply.from-list(1..10).rotor(3 => 0), [[1,2,3],[4,5,6],[7,8,9]], "we can rotor without gap and overlap"; - tap_ok Supply.from-list(1..10).rotor(3 => 0,:!partial), + tap-ok Supply.from-list(1..10).rotor(3 => 0,:!partial), [[1,2,3],[4,5,6],[7,8,9]], "we can rotor without gap and overlap without partial"; - tap_ok Supply.from-list(1..10).rotor(3 => 0,:partial), + tap-ok Supply.from-list(1..10).rotor(3 => 0,:partial), [[1,2,3],[4,5,6],[7,8,9],[10]], "we can rotor without gap and overlap with partial"; - tap_ok Supply.from-list(1..10).rotor(3 => 1), + tap-ok Supply.from-list(1..10).rotor(3 => 1), [[1,2,3],[5,6,7]], "we can rotor with positive gap and overlap"; - tap_ok Supply.from-list(1..10).rotor(3 => 1,:!partial), + tap-ok Supply.from-list(1..10).rotor(3 => 1,:!partial), [[1,2,3],[5,6,7]], "we can rotor with positive gap and overlap without partial"; - tap_ok Supply.from-list(1..10).rotor(3 => 1,:partial), + tap-ok Supply.from-list(1..10).rotor(3 => 1,:partial), [[1,2,3],[5,6,7],[9,10]], "we can rotor with positive gap and overlap with partial"; @@ -53,6 +53,6 @@ for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { my $for = Supply.from-list(1..10); my $rotor = $for.rotor( 1 => 0 ); ok $for === $rotor, "rotoring by 1/0 is a noop"; - tap_ok $rotor, [1..10], "noop rotor"; + tap-ok $rotor, [1..10], "noop rotor"; } } diff --git a/S17-supply/schedule-on.t b/S17-supply/schedule-on.t index 46cbd69861..be9bfc9b85 100644 --- a/S17-supply/schedule-on.t +++ b/S17-supply/schedule-on.t @@ -18,7 +18,7 @@ for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { my $master = Supply.new; ok $master ~~ Supply, 'Did we get a master Supply?'; - tap_ok $master.schedule-on($other_scheduler), + tap-ok $master.schedule-on($other_scheduler), [1,2,3], 'did we get the original values', :live, diff --git a/S17-supply/sort.t b/S17-supply/sort.t index 3ebbd52217..3fca145c94 100644 --- a/S17-supply/sort.t +++ b/S17-supply/sort.t @@ -11,9 +11,9 @@ dies_ok { Supply.sort }, 'can not be called as a class method'; for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { diag "**** scheduling with {$*SCHEDULER.WHAT.perl}"; - tap_ok Supply.from-list(10...1).sort, [1..10], "we can sort numbers"; - tap_ok Supply.from-list("z"..."a").sort, ["a" .. "z"], "we can sort strings"; - tap_ok Supply.from-list("a".."d", "A" .. "D").sort( { + tap-ok Supply.from-list(10...1).sort, [1..10], "we can sort numbers"; + tap-ok Supply.from-list("z"..."a").sort, ["a" .. "z"], "we can sort strings"; + tap-ok Supply.from-list("a".."d", "A" .. "D").sort( { $^a.lc cmp $^b.lc || $^b cmp $^a } ), [], "we can sort in special ways"; } diff --git a/S17-supply/squish.t b/S17-supply/squish.t index 930caee3fa..44a7ab596c 100644 --- a/S17-supply/squish.t +++ b/S17-supply/squish.t @@ -11,23 +11,23 @@ dies_ok { Supply.squish }, 'can not be called as a class method'; for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { diag "**** scheduling with {$*SCHEDULER.WHAT.perl}"; - tap_ok Supply.from-list(1..10,1..10).squish, + tap-ok Supply.from-list(1..10,1..10).squish, [1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10], "squish tap with 2 ranges works"; - tap_ok Supply.from-list(1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10).squish, + tap-ok Supply.from-list(1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10).squish, [1,2,3,4,5,6,7,8,9,10], "squish tap with doubling range works"; - tap_ok Supply.from-list(1..10).squish(:as(* div 2)), + tap-ok Supply.from-list(1..10).squish(:as(* div 2)), [1,2,4,6,8,10], "squish with as tap works"; - tap_ok Supply.from-list().squish( :with( {$^a.lc eq $^b.lc} ) ), + tap-ok Supply.from-list().squish( :with( {$^a.lc eq $^b.lc} ) ), [], "squish with with tap works"; - tap_ok Supply.from-list().squish( + tap-ok Supply.from-list().squish( :as( *.substr(0,1) ), :with( {$^a.lc eq $^b.lc} ) ), [], diff --git a/S17-supply/stable.t b/S17-supply/stable.t index 950fa3dbcb..dc480c029d 100644 --- a/S17-supply/stable.t +++ b/S17-supply/stable.t @@ -14,7 +14,7 @@ for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { #?rakudo skip "doesn't work or can't test" { my $s = Supply.new; - tap_ok $s.stable(2), + tap-ok $s.stable(2), [1,4], ".stable worked", :after-tap( { @@ -35,6 +35,6 @@ for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { my $for = Supply.from-list(1..10); my $stable = $for.stable(0); ok $for === $stable, "stable by 0 is a noop"; - tap_ok $stable, [1..10], "noop stable"; + tap-ok $stable, [1..10], "noop stable"; } } diff --git a/S17-supply/unique.t b/S17-supply/unique.t index 9e5de7b877..0fd2f1d6b7 100644 --- a/S17-supply/unique.t +++ b/S17-supply/unique.t @@ -11,19 +11,19 @@ dies_ok { Supply.unique }, 'can not be called as a class method'; for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { diag "**** scheduling with {$*SCHEDULER.WHAT.perl}"; - tap_ok Supply.from-list(1..10,1..10).unique, + tap-ok Supply.from-list(1..10,1..10).unique, [1,2,3,4,5,6,7,8,9,10], "unique tap works"; - tap_ok Supply.from-list(1..10).unique(:as(* div 2)), + tap-ok Supply.from-list(1..10).unique(:as(* div 2)), [1,2,4,6,8,10], "unique with as tap works"; - tap_ok Supply.from-list().unique( :with( {$^a.lc eq $^b.lc} ) ), + tap-ok Supply.from-list().unique( :with( {$^a.lc eq $^b.lc} ) ), [], "unique with with tap works"; - tap_ok Supply.from-list().unique( + tap-ok Supply.from-list().unique( :as( *.substr(0,1) ), :with( {$^a.lc eq $^b.lc} ) ), [], @@ -31,7 +31,7 @@ for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { { my $s = Supply.new; - tap_ok $s.unique( :expires(2) ), + tap-ok $s.unique( :expires(2) ), [1,2,3,1,2], 'unique with expiry works', :after-tap( { @@ -49,7 +49,7 @@ for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { { my $s = Supply.new; - tap_ok $s.unique( :as( * div 2 ), :expires(2) ), + tap-ok $s.unique( :as( * div 2 ), :expires(2) ), [1,2,1,2], 'unique with as and expiry works', :after-tap( { @@ -67,7 +67,7 @@ for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { { my $s = Supply.new; - tap_ok $s.unique( :with( {$^a.lc eq $^b.lc} ), :expires(2) ), + tap-ok $s.unique( :with( {$^a.lc eq $^b.lc} ), :expires(2) ), [], 'unique with as and expiry works', :after-tap( { @@ -86,7 +86,7 @@ for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { { my $s = Supply.new; - tap_ok $s.unique( + tap-ok $s.unique( :as( *.substr(0,1) ), :with( {$^a.lc eq $^b.lc} ), :expires(2) ), [], 'unique with as and expiry works', diff --git a/S17-supply/words.t b/S17-supply/words.t index 9bfb49168e..8a3b0e04f9 100644 --- a/S17-supply/words.t +++ b/S17-supply/words.t @@ -11,13 +11,13 @@ dies_ok { Supply.words }, 'can not be called as a class method'; for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { diag "**** scheduling with {$*SCHEDULER.WHAT.perl}"; - tap_ok Supply.from-list().words, + tap-ok Supply.from-list().words, ['abbcccddddeeeee'], "handle a simple list of words"; { my $s = Supply.new; - tap_ok $s.words, + tap-ok $s.words, [], "handle chunked lines", :after-tap( { diff --git a/S17-supply/zip-latest.t b/S17-supply/zip-latest.t index 80002c2c9c..6377a127a9 100644 --- a/S17-supply/zip-latest.t +++ b/S17-supply/zip-latest.t @@ -13,7 +13,7 @@ for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { my $s1 = Supply.new; my $s2 = Supply.new; - tap_ok $s1.zip-latest($s2), + tap-ok $s1.zip-latest($s2), [(<2 a>), (<2 b>), (<2 c>), (<3 c>), (<4 c>)], 'zipping 2 supplies works with "zip-latest"', :after-tap( { @@ -34,7 +34,7 @@ for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { my $s2 = Supply.new; my $s3 = Supply.new; - tap_ok Supply.zip-latest($s1, $s2, $s3, :with( &infix:<~> )), + tap-ok Supply.zip-latest($s1, $s2, $s3, :with( &infix:<~> )), [], 'zipping three supplies with ~ works with "zip-latest"', :after-tap( { @@ -62,7 +62,7 @@ for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { my $s2 = Supply.new; my $s3 = Supply.new; - tap_ok Supply.zip-latest($s1, $s2, $s3, :with(&infix:<~>), :initial()), + tap-ok Supply.zip-latest($s1, $s2, $s3, :with(&infix:<~>), :initial()), [], 'zipping three supplies works with "zip-latest"', :after-tap( { @@ -85,7 +85,7 @@ for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { my $s = Supply.from-list(1..10); my $z = Supply.zip-latest($s); ok $s === $z, 'zipping one supply is a noop with "zip-latest"'; - tap_ok $z, [1..10], "noop zip-latest"; + tap-ok $z, [1..10], "noop zip-latest"; } diff --git a/S17-supply/zip.t b/S17-supply/zip.t index df3acfbaf9..531085309b 100644 --- a/S17-supply/zip.t +++ b/S17-supply/zip.t @@ -13,7 +13,7 @@ for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { my $s1 = Supply.new; my $s2 = Supply.new; - tap_ok $s1.zip($s2, :with( &infix:<~> )), + tap-ok $s1.zip($s2, :with( &infix:<~> )), [<1a 2b>], 'zipping taps works', :after-tap( { @@ -27,7 +27,7 @@ for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { } ); } - tap_ok Supply.zip( + tap-ok Supply.zip( Supply.from-list("a".."e"), Supply.from-list("f".."k"), Supply.from-list("l".."p") @@ -39,7 +39,7 @@ for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { my $s = Supply.from-list(1..10); my $z = Supply.zip($s); ok $s === $z, "zipping one supply is a noop"; - tap_ok $z, [1..10], "noop zip"; + tap-ok $z, [1..10], "noop zip"; } throws_like( { Supply.zip(42) }, diff --git a/fudge b/fudge index d0dc04e9ef..65173baaf4 100755 --- a/fudge +++ b/fudge @@ -122,7 +122,7 @@ my $IS = _register_functions( # regex with test functions used in roast # from Test::Util qw(is_run), # from Test::Tap - qw(tap_ok), + qw(tap-ok), # from Test::Compile qw(loads_ok precomp_loads_ok loads_is precomp_loads_is), ); diff --git a/integration/advent2013-day19.t b/integration/advent2013-day19.t index 6127240ee3..7c11a64991 100644 --- a/integration/advent2013-day19.t +++ b/integration/advent2013-day19.t @@ -51,7 +51,7 @@ plan 4; my $samples = Supply.interval(.5).map({ rand }); my $samples_labeled = $samples.map({ Sample => $_}); my $merged = $belt_labeled.merge($samples_labeled); -## todo: use Test::Tap tap_ok +## todo: use Test::Tap tap-ok ## $merged.tap(&say); $belt_raw.done; diff --git a/packages/Test/Tap.pm b/packages/Test/Tap.pm index c4d80437fb..aae4390a27 100644 --- a/packages/Test/Tap.pm +++ b/packages/Test/Tap.pm @@ -2,9 +2,9 @@ module Test::Tap; use Test; -proto sub tap_ok(|) is export { * } +proto sub tap-ok(|) is export { * } -multi sub tap_ok ( +multi sub tap-ok ( $s, $expected, $desc, @@ -47,9 +47,9 @@ Test::Tap - Extra utility code for testing Supply use Test; use Test::Tap; - tap_ok( $supply, [], "comment" ); + tap-ok( $supply, [], "comment" ); - tap_ok( + tap-ok( $supply, [], "text", @@ -67,7 +67,7 @@ This module is for Supply test code. =head1 FUNCTIONS -=head2 tap_ok( $s, [$result], "comment" ) +=head2 tap-ok( $s, [$result], "comment" ) Takes 3 positional parameters: the C to be tested, an array with the expected values, and a comment to describe the test.