Skip to content

Commit

Permalink
Add fudged tests for RT#129215
Browse files Browse the repository at this point in the history
  Perplexingly not be replicable by CompUnit::, needs a real "use"
  • Loading branch information
skids committed Sep 17, 2017
1 parent d776a06 commit 741df51
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
24 changes: 23 additions & 1 deletion S11-modules/export.t
Expand Up @@ -4,7 +4,7 @@ use lib 't/spec/packages';

use Test;

plan 41;
plan 56;

# L<S11/"Exportation"/>

Expand Down Expand Up @@ -171,3 +171,25 @@ ok( ! &EXPORT::DEFAULT::exp_my_tag,
}

# vim: ft=perl6

# RT #129215
{
use RT129215;
ok str_d("foo"), 'Str:D istype across module seam';
ok str_u(Str), 'Str:D istype across module seam';
ok str_u(Str:U), 'Str:D istype across module seam';
ok array_str(Array[Str].new("A","B")), 'Array[Str] istype across module seam';
ok hash_str(Hash[Str].new({ak => "ak"})), 'Hash[Str] istype across module seam';
ok hash_hash_str(Hash[Hash[Str]].new({akk => { ak => "ak" }})), 'Hash[Hash[Str]] istype across module seam';

#?rakudo 3 todo 'Containers parameterized with define type fail istype RT#129215'
ok array_str_d(Array[Str:D].new("A","B")), 'Array[Str:D] istype across module seam';
ok hash_str_d(Hash[Str:D].new({ak => "ak"})), 'Hash[Str:D] istype across module seam';
ok hash_hash_str_d(Hash[Hash[Str:D]].new({akk => { ak => "ak" }})), 'Hash[Hash[Str:D]] istype across module seam';
ok array_str_u(Array[Str:U].new(Str,Str)), 'Array[Str:U] istype across module seam (Str)';
ok hash_str_u(Hash[Str:U].new({ak => Str})), 'Hash[Str:U] istype across module seam (Str)';
ok hash_hash_str_u(Hash[Hash[Str:U]].new({akk => { ak => Str }})), 'Hash[Hash[Str:U]] istype across module seam (Str)';
ok array_str_u(Array[Str:U].new(Str:U,Str:U)), 'Array[Str:U] istype across module seam';
ok hash_str_u(Hash[Str:U].new({ak => Str:U})), 'Hash[Str:U] istype across module seam';
ok hash_hash_str_u(Hash[Hash[Str:U]].new({akk => { ak => Str:U }})), 'Hash[Hash[Str:U]] istype across module seam';
}
15 changes: 15 additions & 0 deletions packages/RT129215.pm6
@@ -0,0 +1,15 @@
unit module RT129215;

sub array_str ($data) is export { $data ~~ Array[Str]; };
sub hash_str ($data) is export { $data ~~ Hash[Str]; };
sub hash_hash_str ($data) is export { $data ~~ Hash[Hash[Str]]; };

sub str_d ($data) is export { $data ~~ Str:D; };
sub array_str_d ($data) is export { $data ~~ Array[Str:D]; };
sub hash_str_d ($data) is export { $data ~~ Hash[Str:D]; };
sub hash_hash_str_d ($data) is export { $data ~~ Hash[Hash[Str:D]]; };

sub str_u ($data) is export { $data ~~ Str:U; };
sub array_str_u ($data) is export { $data ~~ Array[Str:U]; };
sub hash_str_u ($data) is export { $data ~~ Hash[Str:U]; };
sub hash_hash_str_u ($data) is export { $data ~~ Hash[Hash[Str:U]]; };

0 comments on commit 741df51

Please sign in to comment.