From b1a07f0935015484a02905d747ea3acab461be05 Mon Sep 17 00:00:00 2001 From: Zoffix Znet Date: Sat, 15 Sep 2018 18:52:13 -0400 Subject: [PATCH] [v6.d REVIEW] Move IO::Handle.perl.EVAL test to rakudo suite 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: https://github.com/perl6/roast/commit/dbbea1572 --- t/02-rakudo/99-misc.t | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/t/02-rakudo/99-misc.t b/t/02-rakudo/99-misc.t index 3a84895be2a..606570b2cf0 100644 --- a/t/02-rakudo/99-misc.t +++ b/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; @@ -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[], + :nl-out, :encoding; + + 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 ; + } +}