Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Attempt to track IO changes in backwards copatible way
The '.s' (size) method no longer works on IO::Handle, get size
from IO itself.
  • Loading branch information
zengargoyle committed Apr 28, 2017
1 parent 76f92ce commit c60d442
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion t/01_empty.t
Expand Up @@ -4,7 +4,7 @@ plan *;
use Text::Fortune;
let $*CWD = 't/test_data';

my Buf $b = do { my $f = 'empty.dat'.IO.open: :bin; $f.slurp };
my Buf $b = do { my $f = 'empty.dat'.IO; my $s = $f.s; $f.open(:bin).read($s); };
say $b;

given Text::Fortune::Index.new {
Expand Down
2 changes: 1 addition & 1 deletion t/02_simple.t
Expand Up @@ -8,7 +8,7 @@ throws-like { Text::Fortune::Index.new.load-dat( 'not_found.dat' ) },
X::Index::NotFound,
message => rx:s/not found/;

my Buf $b = do { my $f = 'empty.dat'.IO.open; $f.read($f.s) };
my Buf $b = do { my $f = 'empty.dat'.IO; my $s = $f.s; $f.open(:bin).read($s); };

given Text::Fortune::Index.new.load-dat( 'empty.dat' ) {
is .version, 2, 'is version: 2';
Expand Down
2 changes: 1 addition & 1 deletion t/03_dodat.t
Expand Up @@ -4,7 +4,7 @@ plan *;
use Text::Fortune;
let $*CWD = 't/test_data';

my Buf $b = do { my $f = 'with_dat.dat'.IO.open; $f.read($f.s) };
my Buf $b = do { my $f = 'with_dat.dat'.IO; my $s = $f.s; $f.open(:bin).read($s); };

given Text::Fortune::Index.new.load-dat( 'with_dat.dat' ) {
is .offset-at(0), 0, 'first offset correct';
Expand Down
4 changes: 2 additions & 2 deletions t/04_nodat.t
Expand Up @@ -4,8 +4,8 @@ plan *;
use Text::Fortune;
let $*CWD = 't/test_data';

my Buf $b = do { my $f = 'with_dat.dat'.IO.open; $f.read($f.s) };
my Buf $be = do { my $f = 'empty.dat'.IO.open; $f.read($f.s) };
my Buf $b = do { my $f = 'with_dat.dat'.IO; my $s = $f.s; $f.open(:bin).read($s); };
my Buf $be = do { my $f = 'empty.dat'.IO; my $s = $f.s; $f.open(:bin).read($s); };

given Text::Fortune::Index.new.load-fortune( 'with_dat' ) {
is .offset-at(0), 0, 'first offset correct';
Expand Down

0 comments on commit c60d442

Please sign in to comment.