Skip to content

Commit

Permalink
[v6.d REVIEW] Move IO::Handle.perl.EVAL test to rakudo suite
Browse files Browse the repository at this point in the history
Handles are a bit of a weird thing to roundtrip through eval and
we don't keep the openness, file descriptor, nor file position,
so it's possible in the future we'd die, similar to
how (1...*).perl dies.

Orig: Raku/roast@dbbea1572
  • Loading branch information
zoffixznet committed Sep 15, 2018
1 parent 8fcebb8 commit b1a07f0
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion t/02-rakudo/99-misc.t
@@ -1,5 +1,5 @@
use Test;
plan 1;
plan 2;

subtest '.lang-ver-before method on Perl6::World' => {
plan 5;
Expand All @@ -13,3 +13,17 @@ subtest '.lang-ver-before method on Perl6::World' => {
:self{.exception.message.contains: 'must be 1 char long'},
'using wrong version format as argument throws';
}

subtest 'IO::Handle.perl.EVAL roundtrips' => {
plan 7;

my $orig = IO::Handle.new: :path("foo".IO), :!chomp, :nl-in[<I ♥ Perl 6>],
:nl-out<foo>, :encoding<ascii>;

is-deeply IO::Handle.perl.EVAL, IO::Handle, 'type object';
given $orig.perl.EVAL -> $evaled {
is-deeply $evaled, $orig, 'instance';
is-deeply $evaled."$_"(), $orig."$_"(), $_
for <path chomp nl-in nl-out encoding>;
}
}

0 comments on commit b1a07f0

Please sign in to comment.