Skip to content

Commit

Permalink
Batch #23 of roast RT -> GH ticket migration
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Jan 24, 2020
1 parent b5c79ae commit d03ba41
Show file tree
Hide file tree
Showing 14 changed files with 64 additions and 35 deletions.
10 changes: 6 additions & 4 deletions S32-io/IO-Socket-Async.t
Expand Up @@ -125,7 +125,7 @@ $echoTap.close;
is $splitResult.decode('utf-8'), "пиво\n", 'Coped with UTF-8 bytes split across packets';
}

# RT #128862
# https://github.com/Raku/old-issue-tracker/issues/5542
{
my $failed = False;
my $badInputTap = $server.tap(-> $c {
Expand Down Expand Up @@ -154,7 +154,8 @@ $echoTap.close;
$c.write($binary).then({ $c.close });
});

#?rakudo.jvm todo 'unknown problem, did hang (sometimes) RT #127948'
# https://github.com/Raku/old-issue-tracker/issues/5249
#?rakudo.jvm todo 'unknown problem, did hang (sometimes)'
{
my $received = await client(Buf.new);
ok $binary eqv $received, 'bytes-supply';
Expand Down Expand Up @@ -198,7 +199,7 @@ $echoTap.close;
$byteCountTap.close;
}

# RT#132135
# https://github.com/Raku/old-issue-tracker/issues/6541
{
my Str @hosts = '127.0.0.1';

Expand Down Expand Up @@ -309,7 +310,7 @@ $echoTap.close;
is @second-got.join(""), "hello second", "second server socket got the right message";
}

# Rakudo Issue #2411
# https://github.com/rakudo/rakudo/issues/2411
{
my $listen-socket = IO::Socket::Async.listen($s-address, 0);
react {
Expand All @@ -320,3 +321,4 @@ $echoTap.close;
}
}

# vim: ft=perl6 expandtab sw=4
19 changes: 12 additions & 7 deletions S32-io/io-cathandle.t
Expand Up @@ -215,7 +215,8 @@ subtest 'getc method' => {
my $fh2 = make-temp-file content => "\x[308]a♥b\x[308]♥c♥";
my $cat = IO::CatHandle.new: $fh1, $fh2;
my @res; @res.push($_) while ($_ = $cat.getc).DEFINITE;
#?rakudo todo 'RT 131365'
# https://github.com/Raku/old-issue-tracker/issues/6258
#?rakudo todo 'end of file'
is-deeply @res, [
"a\x[308]\x[308]\x[308]", "\n", "\x[308]\x[308]", "\n",
"\x[308]", "c", "\x[308]", "a", "", "b\x[308]", "", "c", ""
Expand Down Expand Up @@ -685,7 +686,8 @@ subtest 'slurp method' => {
sub files { make-files @data }

is-deeply IO::CatHandle.new(files).slurp, @data.join, 'non-binary';
#?rakudo.jvm todo 'problem with equivalence of Buf objects, RT #128041'
# https://github.com/Raku/old-issue-tracker/issues/5283
#?rakudo.jvm todo 'problem with equivalence of Buf objects'
is-deeply IO::CatHandle.new(files, :bin).slurp,
Buf[uint8].new(@data.join.encode), 'binary';

Expand All @@ -697,8 +699,8 @@ subtest 'slurp method' => {
~ Blob[uint8].new(200, 200 ).decode('utf8-c8'),
':enc parameter works';

#?rakudo.moar todo 'malformed 1-char slurp returns empty string RT#131379'
# RT #131379
# https://github.com/Raku/old-issue-tracker/issues/6278
#?rakudo.moar todo 'malformed 1-char slurp returns empty string'
throws-like {
IO::CatHandle.new(files, make-temp-file content => Buf.new: 200).slurp
}, Exception, 'file containing single non-valid-UTF8 byte throws in utf8 slurp';
Expand Down Expand Up @@ -763,7 +765,8 @@ subtest 'Supply method' => {
'size 1000';
}
subtest 'non-binary cat, utf8' => { plan 4;
#?rakudo.moar 4 todo 'readchars reads wrong num of chars RT131383'
# https://github.com/Raku/old-issue-tracker/issues/6281
#?rakudo.moar 4 todo 'readchars reads wrong num of chars'
is-deeply cat-supply, [$str], 'no args';
is-deeply cat-supply(\(), \(:2size)), [$str.comb: 2], 'size 2';
is-deeply cat-supply(\(), \(:5size)), [$str.comb: 5], 'size 5';
Expand All @@ -774,7 +777,8 @@ subtest 'Supply method' => {
my @bits = buf8.new(200), buf8.new(200, 200), buf8.new(200, 42, 70);
#?rakudo.jvm emit # Unsupported VM encoding 'utf8-c8'
my $str = ([~] @bits).decode: 'utf8-c8';
#?rakudo.moar 4 todo 'readchars reads wrong num of chars RT131383'
# https://github.com/Raku/old-issue-tracker/issues/6281
#?rakudo.moar 4 todo 'readchars reads wrong num of chars'
#?rakudo.jvm 4 skip "Unsupported VM encoding 'utf8-c8'"
is-deeply cat-supply(c, \( ), @bits), [$str], 'no args';
is-deeply cat-supply(c, \(:2size ), @bits), [$str.comb: 2], 'size 2';
Expand Down Expand Up @@ -864,7 +868,8 @@ subtest 'words method' => {
}

if $*DISTRO.is-win {
skip "Proc/Proc::Async with cmd.exe don't quite work on Windows: RT132258";
# https://github.com/Raku/old-issue-tracker/issues/6591
skip "Proc/Proc::Async with cmd.exe don't quite work on Windows";
}
else {
# https://github.com/rakudo/rakudo/issues/1313
Expand Down
4 changes: 3 additions & 1 deletion S32-io/io-path-cygwin.t
Expand Up @@ -83,6 +83,8 @@ is $numfile.pred, "foo/file00.txt", "pred basic";
is IO::Path::Cygwin.new("foo/()").succ, "foo/()", "succ only effects basename";
is IO::Path::Cygwin.new("foo/()").succ, "foo/()", "pred only effects basename";

# RT#128840
# https://github.com/Raku/old-issue-tracker/issues/5531
isnt IO::Path::Cygwin.new('-a').absolute, '',
'.absolute on paths starting with `-` does not produce empty string';

# vim: ft=perl6
4 changes: 3 additions & 1 deletion S32-io/io-path-unix.t
Expand Up @@ -67,6 +67,8 @@ is $numfile.pred, "foo/file00.txt", "pred basic";
is IO::Path::Unix.new("foo/()").succ, "foo/()", "succ only effects basename";
is IO::Path::Unix.new("foo/()").succ, "foo/()", "pred only effects basename";

# RT#128840
# https://github.com/Raku/old-issue-tracker/issues/5531
isnt IO::Path::Unix.new("-a").absolute, '',
'.absolute on paths starting with `-` does not produce empty string';

# vim: ft=perl6
4 changes: 3 additions & 1 deletion S32-io/io-path-win.t
Expand Up @@ -82,6 +82,8 @@ is $numfile.pred, "foo\\file00.txt", "pred basic";
is IO::Path::Win32.new("foo\\()").succ, "foo\\()", "succ only effects basename";
is IO::Path::Win32.new("foo\\()").succ, "foo\\()", "pred only effects basename";

# RT#128840
# https://github.com/Raku/old-issue-tracker/issues/5531
isnt IO::Path::Win32.new('-a').absolute, '',
'.absolute on paths starting with `-` does not produce empty string';

# vim: ft=perl6
13 changes: 8 additions & 5 deletions S32-io/io-path.t
Expand Up @@ -51,8 +51,8 @@ isa-ok $path.IO, IO::Path, 'IO::Path.IO returns IO::Path';
}
}

# RT #126935
# RT #131185
# https://github.com/Raku/old-issue-tracker/issues/4877
# https://github.com/Raku/old-issue-tracker/issues/6200
subtest '.raku.EVAL rountrips' => {
my @tests = gather {
.IO.take for q/\x[308]foo|ba"'\''r/, "/foo|\\bar", "/foo\tbar";
Expand Down Expand Up @@ -86,19 +86,20 @@ subtest '.raku.EVAL rountrips' => {
}
}

{ # RT #127989
# https://github.com/Raku/old-issue-tracker/issues/5265
{
try IO::Path.new: 'foo', 'bar';
cmp-ok $!, &[!~~], X::Constructor::Positional,
'IO::Path.new with wrong args must not claim it only takes named ones';
}

# RT #128097
# https://github.com/Raku/old-issue-tracker/issues/5306
{
is IO::Handle.new(:path('-')).path.gist, '"-".IO', '"-" as the path of an IO::Handle gists correctly';
is '-'.IO.gist, '"-".IO', '"-".IO gists correctly';
}

# RT #130889
# https://github.com/Raku/old-issue-tracker/issues/6111
{
my $file = ("S32-io-path-RT-130889-test" ~ rand);
LEAVE $file.IO.unlink;
Expand Down Expand Up @@ -429,3 +430,5 @@ subtest '.parent(Int)' => {
is-deeply $p.parent(6), $p.parent.parent.parent.parent.parent.parent, "6 $d";
}
}

# vim: ft=perl6
6 changes: 4 additions & 2 deletions S32-io/mkdir_rmdir.t
Expand Up @@ -31,7 +31,8 @@ plan 7;
}

# mkdir in a dir that doesn't exist
#?rakudo skip "mkdir NYI RT #124791"
# https://github.com/Raku/old-issue-tracker/issues/3999
#?rakudo skip "mkdir NYI"
{
# XXX: mkdir creates nested directories if they don't exist,
# so does this test make sense anymore?
Expand All @@ -41,6 +42,7 @@ plan 7;
}

# mkdir a dir that already exists
# https://github.com/Raku/old-issue-tracker/issues/3999
#?rakudo skip "mkdir NYI RT #124792"
{
# XXX: mkdir returns True (pre 2017.05) or the IO::Path itself
Expand All @@ -49,7 +51,7 @@ plan 7;
fails-like { $dir.mkdir }, X::IO::Mkdir;
}

# RT #126976
# https://github.com/Raku/old-issue-tracker/issues/4899
{
try { "/".IO.mkdir } for ^5;
pass '"/".IO.mkdir does not segfault';
Expand Down
7 changes: 4 additions & 3 deletions S32-io/open.t
Expand Up @@ -211,7 +211,8 @@ subtest '.open uses attributes by default' => {
is-deeply $fh.encoding, Nil, '.encoding is Nil due to :bin';
is-deeply $fh.chomp, False, '.chomp remains same after open';

#?rakudo.jvm todo 'problem with Buf[uint8], probably related to RT #128041'
# https://github.com/Raku/old-issue-tracker/issues/5283
#?rakudo.jvm todo 'problem with Buf[uint8]'
is-deeply $fh.slurp, Buf[uint8].new($content.encode),
'.encoding is respected';
$fh.close;
Expand All @@ -230,7 +231,7 @@ subtest '.open uses attributes by default' => {
$fh.close;
}

# RT #131755
# https://github.com/Raku/old-issue-tracker/issues/6394
subtest '.DESTROY does not close standard handles' => {
plan 3;
for $*IN, $*OUT, $*ERR {
Expand All @@ -239,7 +240,7 @@ subtest '.DESTROY does not close standard handles' => {
}
}

# RT #125813
# https://github.com/Raku/old-issue-tracker/issues/4473
throws-like ('a' x 975).IO.open, Exception,
:message{not /:i 'Malformed UTF-8'/},
'.open error does not incorrectly complain about malformed UTF-8';
Expand Down
4 changes: 3 additions & 1 deletion S32-io/other-stress.t
Expand Up @@ -5,9 +5,11 @@ use Test::Util;

plan 60;

# RT #117841
# https://github.com/Raku/old-issue-tracker/issues/3120
for 1..12 -> $x {
for map { 2**$x - 1 }, ^5 {
ok( get_out("say 1 x $_,q|—|", '')<out> ~~ /^1+\—\s*$/, "Test for $_ bytes + utf8 char");
}
}

# vim: ft=perl6
9 changes: 6 additions & 3 deletions S32-io/pipe.t
Expand Up @@ -41,7 +41,8 @@ sub proc_captures_out_ok($code, $out, $exitcode, $desc) {
is $sh.out.slurp(:close), "baz\nbar\nfoo\n", 'Can talk to subprocess bidirectional';
}

#?rakudo.jvm skip 'hangs, RT #131393'
# https://github.com/Raku/old-issue-tracker/issues/6288
#?rakudo.jvm skip 'hangs'
{
my $sh1 = run($*EXECUTABLE, '-e', 'say join "\n", reverse lines', :in, :out);
my $sh2 = run($*EXECUTABLE, '-e', 'my @l = lines; .say for @l; note @l.elems', :in($sh1.out), :out, :err);
Expand All @@ -52,7 +53,7 @@ sub proc_captures_out_ok($code, $out, $exitcode, $desc) {
$sh1.out.close;
}

# RT #125796
# https://github.com/Raku/old-issue-tracker/issues/4468
{
my $p = run $*EXECUTABLE, '-e', 'say 42 for ^10', :out;
my @lines = $p.out.lines;
Expand Down Expand Up @@ -87,7 +88,7 @@ group-of 5 => 'bin pipes in Proc do not crash on open' => {
is $stderr.lines.head, "24", 'STDERR is right';
}

# RT #129882
# https://github.com/Raku/old-issue-tracker/issues/5749
{
my $proc = run $*EXECUTABLE, '-e', 'print slurp', :in, :out, :bin;
my $input = ('a' x 1_000_000).encode;
Expand All @@ -98,3 +99,5 @@ group-of 5 => 'bin pipes in Proc do not crash on open' => {
is $proc.out.slurp(:close, :bin).bytes, 1_000_000, 'large blob can be piped';
await $promise;
}

# vim: ft=perl6 expandtab sw=4
3 changes: 2 additions & 1 deletion S32-io/slurp.t
Expand Up @@ -95,7 +95,8 @@ subtest '&slurp(IO::Handle)' => {
], 'slurp() uses $*ARGFILES (binary mode)';

is-deeply slurp('foo'.&f.open), 'foo', 'slurp($fh)';
#?rakudo.jvm todo 'problem with equivalence of Buf objects, RT #128041'
# https://github.com/Raku/old-issue-tracker/issues/5283
#?rakudo.jvm todo 'problem with equivalence of Buf objects'
is-deeply slurp('foo'.&f.open: :bin), Buf[uint8].new(102,111,111),
'slurp($fh, :bin)';
#?rakudo.jvm skip "Unsupported VM encoding 'utf8-c8'"
Expand Down
8 changes: 5 additions & 3 deletions S32-io/socket-accept-and-working-threads.t
Expand Up @@ -2,7 +2,7 @@ use Test;

plan 15;

# RT #129213
# https://github.com/Raku/old-issue-tracker/issues/5643
{
my class Dummy { has ($.a, $.b, $.c, $.d, $.e) }

Expand Down Expand Up @@ -39,8 +39,8 @@ plan 15;
}
}

# MoarVM #165 (could not recv in a thread besides where the socket was
# accepted)
# https://github.com/MoarVM/MoarVM/issues/1650
# could not recv in a thread besides where the socket was accepted
{
my $ready = Promise.new;

Expand Down Expand Up @@ -68,3 +68,5 @@ plan 15;
$conn.close;
}
}

# vim: ft=perl6
5 changes: 4 additions & 1 deletion S32-io/socket-fail-invalid-values.t
@@ -1,6 +1,7 @@
use Test;

# RT #130473, #130475
# https://github.com/Raku/old-issue-tracker/issues/5959
# https://github.com/Raku/old-issue-tracker/issues/5961

my $localhost = '0.0.0.0';

Expand Down Expand Up @@ -56,3 +57,5 @@ sub family-too-high() {
:family(FAMILY_VALUE_TOO_HIGH),
);
}

# vim: ft=perl6
3 changes: 1 addition & 2 deletions S32-io/tell.t
Expand Up @@ -67,12 +67,11 @@ subtest 'open(:bin) handle' => {
$fh.close;
}

# RT #132254
# https://github.com/Raku/old-issue-tracker/issues/6590
# TTY handles like STDOUT keep track of how many bytes were sent to give faked
# out .tell results. The bug in #132254 existed due to .tell on TTY, so
# let's use $*OUT for the test and rely on previous TAP output to have shifted
# the .tell value by some bytes, due to previously printed content
cmp-ok $*OUT.tell, '!=', 0, '.tell gave us some non-zero value';


# vim: ft=perl6

0 comments on commit d03ba41

Please sign in to comment.