Skip to content

Commit dbbea15

Browse files
committed
[io grant] Test IO::Handle.perl.EVAL roundtrips
Rakudo fix: rakudo/rakudo@a282b8c896
1 parent 8e445f8 commit dbbea15

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

S32-io/io-handle.t

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use lib <t/spec/packages>;
33
use Test;
44
use Test::Util;
55

6-
plan 23;
6+
plan 24;
77

88
my $path = "io-handle-testfile";
99

@@ -188,3 +188,17 @@ subtest '.encoding attribute' => {
188188
is-deeply $fh.encoding, 'bin', 'attribute got set (bin)';
189189
}
190190
}
191+
192+
subtest '.perl.EVAL roundtrips' => {
193+
plan 7;
194+
195+
my $orig = IO::Handle.new: :path("foo".IO), :!chomp, :nl-in[<I ♥ Perl 6>],
196+
:nl-out<foo>, :encoding<ascii>;
197+
198+
is-deeply IO::Handle.perl.EVAL, IO::Handle, 'type object';
199+
given $orig.perl.EVAL -> $evaled {
200+
is-deeply $evaled, $orig, 'instance';
201+
is-deeply $evaled."$_"(), $orig."$_"(), $_
202+
for <path chomp nl-in nl-out encoding>;
203+
}
204+
}

0 commit comments

Comments
 (0)