Skip to content

Commit

Permalink
[v6.d REVIEW] Expand infix:<~> with Blob tests
Browse files Browse the repository at this point in the history
- Test both return and result of meta assign
- Test other forms of the op
Origs:
a85c4b4
7073efe
  • Loading branch information
zoffixznet committed Dec 31, 2017
1 parent 22f00c7 commit 37133cb
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions S03-operators/buf.t
Expand Up @@ -284,11 +284,19 @@ nok Buf eqv Blob, 'Buf eqv Blob lives, works';
}

# RT #126529
{
subtest 'infix:<~> works with Blob' => {
plan 6;

my Blob $a = "a".encode;
my Blob $b = "b".encode;
$a ~= $b;
is $a, utf8.new(97,98), 'infix:<~> with Blob does not die';
is-deeply $a ~= $b, 'ab'.encode, 'meta-assign form, return value';
is-deeply $a, 'ab'.encode, 'meta-assign form, result';

is-deeply 'a'.encode ~ 'b'.encode, 'ab'.encode, 'a ~ b';
is-deeply infix:<~>('a'.encode, 'b'.encode), 'ab'.encode, 'infix:<~>(a, b)';
is-deeply ([~] 'a'.encode), 'a'.encode, '[~] with 1 blob';
is-deeply ([~] 'a'.encode, 'b'.encode, 'c'.encode), 'abc'.encode,
'[~] with 3 blobs';
}

# RT #128655
Expand Down

0 comments on commit 37133cb

Please sign in to comment.