Skip to content

Commit 86eb1fe

Browse files
committed
correct subbuf range tests
Zoffix++
1 parent ac0962d commit 86eb1fe

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

S03-operators/buf.t

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use v6;
22
use Test;
33

4-
plan 145;
4+
plan 146;
55

66
ok (~^"foo".encode eqv utf8.new(0x99, 0x90, 0x90)), 'prefix:<~^>';
77

@@ -219,10 +219,12 @@ throws-like { Buf.new().subbuf(0, -1) }, X::OutOfRange,
219219

220220
{
221221
my $b = Buf.new(^100);
222-
is-deeply $b.subbuf(10..10), Buf.new(),
223-
'empty range (10..10) gives empty buf in subbuf';
224-
is-deeply $b.subbuf(10..11), Buf.new(10),
225-
'one-element range (10..11) gives a single element buf in subbuf';
222+
is-deeply $b.subbuf(10..10), Buf.new(10),
223+
'single-element range (10..10) gives a single element buf in subbuf';
224+
is-deeply $b.subbuf(10..11), Buf.new(10, 11),
225+
'two-element range (10..11) gives two element buf in subbuf';
226+
is-deeply $b.subbuf(10..^10), Buf.new(),
227+
'empty range (10..^10) gives empty buf in subbuf';
226228
is-deeply $b.subbuf(10..1), Buf.new(),
227229
'negative range (10..1) gives an empty buf in subbuf';
228230
}

0 commit comments

Comments
 (0)