Skip to content

Commit

Permalink
slurp happy test
Browse files Browse the repository at this point in the history
  • Loading branch information
FGasper committed Mar 24, 2021
1 parent a8ff852 commit 050e5af
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions t/failure.t
Expand Up @@ -88,6 +88,7 @@ for my $path_fn_ar (
[ 'rename2', "$dir/qweqweqew", 0 ],
[ 'readlink' ],
[ 'truncate', 0 ],
[ 'slurp', 0, 0 ],
) {
my ($fn, @xtra_args) = @$path_fn_ar;

Expand Down
10 changes: 10 additions & 0 deletions t/general.t
Expand Up @@ -57,6 +57,16 @@ is_deeply( \@success, ['read', length $to_write], 'success on read' );

is($data, $to_write, '… and the buffer is filled');

IO::AIO::Promiser::slurp("$dir/file", 0, 0)->then(
sub { @success = ('slurp', shift) },
);

IO::AIO::flush;

is_deeply( \@success, ['slurp', $to_write], 'success on slurp' );

#----------------------------------------------------------------------

IO::AIO::Promiser::stat($fh)->then(
sub { @success = ('stat', (stat _)[7]) },
);
Expand Down
13 changes: 13 additions & 0 deletions t/import.t
@@ -0,0 +1,13 @@
#!/usr/bin/env perl

use strict;
use warnings;

use Test::More;
use Test::FailWarnings;

use IO::AIO::Promiser ':all';

can_ok( __PACKAGE__, 'aio_open' );

done_testing;
13 changes: 13 additions & 0 deletions t/nonimport.t
@@ -0,0 +1,13 @@
#!/usr/bin/env perl

use strict;
use warnings;

use Test::More;
use Test::FailWarnings;

use IO::AIO::Promiser;

ok( !__PACKAGE__->can('aio_open'), 'default does NOT export' );

done_testing;

0 comments on commit 050e5af

Please sign in to comment.