randyk 2004/07/07 23:13:35
Modified: t/apr-ext perlio.t Log: swap order of args to t_cmp in t/apr-ext tests to use new ($received, $expected, $comment) syntax. Revision Changes Path 1.6 +22 -22 modperl-2.0/t/apr-ext/perlio.t Index: perlio.t =================================================================== RCS file: /home/cvs/modperl-2.0/t/apr-ext/perlio.t,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- perlio.t 16 Jun 2004 03:55:48 -0000 1.5 +++ perlio.t 8 Jul 2004 06:13:34 -0000 1.6 @@ -88,8 +88,8 @@ ok 0; close $fh; } else { - ok t_cmp($errno_string, - "$!", + ok t_cmp("$!", + $errno_string, "expected failure"); } } @@ -107,8 +107,8 @@ my $pos = 3; # rewinds after reading 6 chars above seek $fh, $pos, Fcntl::SEEK_SET(); my $got = tell($fh); - ok t_cmp($pos, - $got, + ok t_cmp($got, + $pos, "seek/tell the file Fcntl::SEEK_SET"); # Fcntl::SEEK_CUR() @@ -116,16 +116,16 @@ $pos = tell($fh) + $step; seek $fh, $step, Fcntl::SEEK_CUR(); $got = tell($fh); - ok t_cmp($pos, - $got, + ok t_cmp($got, + $pos, "seek/tell the file Fcntl::SEEK_CUR"); # Fcntl::SEEK_END() $pos = -s $file; seek $fh, 0, Fcntl::SEEK_END(); $got = tell($fh); - ok t_cmp($pos, - $got, + ok t_cmp($got, + $pos, "seek/tell the file Fcntl::SEEK_END"); close $fh; @@ -140,15 +140,15 @@ ok ref($fh) eq 'GLOB'; # basic single line read - ok t_cmp($expected, - scalar(<$fh>), + ok t_cmp(scalar(<$fh>), + $expected, "single line read"); # slurp mode seek $fh, 0, Fcntl::SEEK_SET(); # rewind to the start local $/; - ok t_cmp($expected_all, - scalar(<$fh>), + ok t_cmp(scalar(<$fh>), + $expected_all, "slurp file"); # test ungetc (a long sep requires read ahead) @@ -156,8 +156,8 @@ local $/ = $sep; my @got_lines = <$fh>; my @expect = ($lines[0] . $sep, $lines[1]); - ok t_cmp([EMAIL PROTECTED], - [EMAIL PROTECTED], + ok t_cmp([EMAIL PROTECTED], + [EMAIL PROTECTED], "custom complex input record sep read"); close $fh; @@ -178,8 +178,8 @@ t_debug($received); - ok t_cmp(1, - eof($fh), + ok t_cmp(eof($fh), + 1, "end of file"); close $fh; } @@ -197,8 +197,8 @@ my $received = <$dup_fh>; close $dup_fh; - ok t_cmp($expected, - $received, + ok t_cmp($received, + $expected, "read/write a dupped file"); } @@ -214,16 +214,16 @@ my $oldfh = select($wfh); $| = 1; select($oldfh); print $wfh $expected; # must be flushed to disk immediately - ok t_cmp($expected, - scalar(<$rfh>), + ok t_cmp(scalar(<$rfh>), + $expected, "file unbuffered write"); # buffer up $oldfh = select($wfh); $| = 0; select($oldfh); print $wfh $expected; # should be buffered up and not flushed - ok t_cmp(undef, - scalar(<$rfh>), + ok t_cmp(scalar(<$rfh>), + undef, "file buffered write"); close $wfh;