Skip to content

Commit

Permalink
Change handle .encoding tests for binary
Browse files Browse the repository at this point in the history
It was made to be Nil for binary in handle refactor:
rakudo/rakudo@f2fca0c...41bb137

The tests were added 13 days ago and are not part of 6.c-errata
  • Loading branch information
zoffixznet committed May 26, 2017
1 parent 6ecd8c2 commit b136495
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions S32-io/io-handle.t
Expand Up @@ -101,7 +101,8 @@ subtest 'iterator-producing read methods not affected by internal chunking' => {
}
}

is-deeply IO::Handle.new.encoding, 'utf8', 'unopened handle has utf8 encoding';
is-deeply IO::Handle.new.encoding, Nil,
'unopened handle does not have set encoding';

subtest '.flush' => {
# XXX TODO: it doesn't appear we're buffering anything at the moment;
Expand Down Expand Up @@ -167,8 +168,8 @@ subtest '.encoding attribute' => {
my $fh = IO::Handle.new;
is-deeply ($fh.encoding('ascii')), 'ascii', 'return value';
is-deeply $fh.encoding, 'ascii', 'attribute got set';
is-deeply ($fh.encoding('bin')), 'bin', 'return value (bin)';
is-deeply $fh.encoding, 'bin', 'attribute got set (bin)';
is-deeply ($fh.encoding('bin')), Nil, 'return value (bin)';
is-deeply $fh.encoding, Nil, 'attribute got set (bin)';
}

subtest 'opened handle' => {
Expand All @@ -177,8 +178,8 @@ subtest '.encoding attribute' => {
#?rakudo.jvm 2 skip '[io grant] StackOverflowError'
is-deeply ($fh.encoding('ascii')), 'ascii', 'return value';
is-deeply $fh.encoding, 'ascii', 'attribute got set';
is-deeply ($fh.encoding('bin')), 'bin', 'return value (bin)';
is-deeply $fh.encoding, 'bin', 'attribute got set (bin)';
is-deeply ($fh.encoding('bin')), Nil, 'return value (bin)';
is-deeply $fh.encoding, Nil, 'attribute got set (bin)';
}

subtest 'opened, then closed handle' => {
Expand All @@ -187,8 +188,8 @@ subtest '.encoding attribute' => {
$fh.close;
is-deeply ($fh.encoding('ascii')), 'ascii', 'return value';
is-deeply $fh.encoding, 'ascii', 'attribute got set';
is-deeply ($fh.encoding('bin')), 'bin', 'return value (bin)';
is-deeply $fh.encoding, 'bin', 'attribute got set (bin)';
is-deeply ($fh.encoding('bin')), Nil, 'return value (bin)';
is-deeply $fh.encoding, Nil, 'attribute got set (Nil)';
}
}

Expand Down

0 comments on commit b136495

Please sign in to comment.