Skip to content

Instantly share code, notes, and snippets.

@zoffixznet
Created April 8, 2017 13:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zoffixznet/efc86cb85e2dbd14a276755a479b5021 to your computer and use it in GitHub Desktop.
Save zoffixznet/efc86cb85e2dbd14a276755a479b5021 to your computer and use it in GitHub Desktop.
cpan@perlbuild2~/CPANPRC/rakudo (nom)$ ls t/spec/packages/Test/Util.pm
t/spec/packages/Test/Util.pm
cpan@perlbuild2~/CPANPRC/rakudo (nom)$ cat t/spec/S32-io/io-handle.t
use v6;
use <t/spec/packages/>;
use Test;
use Test::Util;
plan 4;
my $path = "io-handle-testfile";
##
# Test that we flush when we go out of scope
{
{
my $fh = $path.IO.open(:w);
$fh.print("42");
}
is slurp($path), "42", "buffer is flushed when IO goes out of scope";
}
# RT #78454
{
$path.IO.open(:w).print("24");
is slurp($path), "24", "buffer is flushed when IO goes out of scope";
}
# RT #123888
#?rakudo.jvm todo 'RT #123888'
{
{
$path.IO.open(:w).print("A+B+C+D+");
}
my $RT123888 = $path.IO.open(:r);
$RT123888.nl-in = "+";
is $RT123888.lines, <A B C D>, "Changing input-line-separator works for .lines";
}
try { unlink $path }
CATCH {
try { unlink $path; }
}
if $path.IO.e {
say "Warn: '$path shouldn't exist";
unlink $path;
}
cmp-ok .open(:w).IO.resolve, '~~', .resolve,
'IO::Handle.IO returns the path it was opened on',
with make-temp-file;
cpan@perlbuild2~/CPANPRC/rakudo (nom)$ t/fudgeandrun t/spec/S32-io/io-handle.t
t/spec/S32-io/io-handle.t .. ===SORRY!===
Could not find Test::Util at line 4 in:
/home/cpan/CPANPRC/rakudo/lib
/home/cpan/.perl6
/home/cpan/CPANPRC/rakudo/install/share/perl6/site
/home/cpan/CPANPRC/rakudo/install/share/perl6/vendor
/home/cpan/CPANPRC/rakudo/install/share/perl6
CompUnit::Repository::AbsolutePath<67164096>
CompUnit::Repository::NQP<43073544>
CompUnit::Repository::Perl5<43073584>
Dubious, test returned 1 (wstat 256, 0x100)
No subtests run
Test Summary Report
-------------------
t/spec/S32-io/io-handle.t (Wstat: 256 Tests: 0 Failed: 0)
Non-zero exit status: 1
Parse errors: No plan found in TAP output
Files=1, Tests=0, 0 wallclock secs ( 0.01 usr 0.00 sys + 0.13 cusr 0.03 csys = 0.17 CPU)
Result: FAIL
cpan@perlbuild2~/CPANPRC/rakudo (nom)$ make t/spec/S32-io/io-handle.t
rm -f -- perl6
cp -- perl6-m perl6
chmod -- 755 perl6
/home/cpan/perl5/perlbrew/perls/perl-5.24.0/bin/perl t/harness5 --fudge --moar --keep-exit-code --verbosity=1 t/spec/S32-io/io-handle.t
Dubious, test returned 1 (wstat 256, 0x100)
No subtests run
Test Summary Report
-------------------
t/spec/S32-io/io-handle.t (Wstat: 256 Tests: 0 Failed: 0)
Non-zero exit status: 1
Parse errors: No plan found in TAP output
Files=1, Tests=0, 0 wallclock secs ( 0.02 usr 0.00 sys + 0.12 cusr 0.04 csys = 0.18 CPU)
Result: FAIL
Makefile:632: recipe for target 't/spec/S32-io/io-handle.t' failed
make: *** [t/spec/S32-io/io-handle.t] Error 1
cpan@perlbuild2~/CPANPRC/rakudo (nom)$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment