/[fuse-comp]/t/fs.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /t/fs.t

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 12 by dpavlin, Mon Jul 9 10:35:02 2007 UTC revision 13 by dpavlin, Mon Jul 9 11:12:48 2007 UTC
# Line 4  use warnings; Line 4  use warnings;
4    
5  my $debug = shift @ARGV;  my $debug = shift @ARGV;
6    
7  use Test::More tests => 227;  use Test::More tests => 250;
8  use File::Slurp;  use File::Slurp;
9  use IO::File;  use IO::File;
10    
# Line 21  sub dump_debug { Line 21  sub dump_debug {
21          ok( open(my $d, '<', "$to/.debug"), 'open debug' );          ok( open(my $d, '<', "$to/.debug"), 'open debug' );
22          local $/;          local $/;
23          my $dump = <$d>;          my $dump = <$d>;
24          diag "DEBUG: $msg\n$dump\n";          diag "DEBUG: $msg\n$dump\n" if $debug;
25          ok( close($d), 'close debug' );          ok( close($d), 'close debug' );
26  }  }
27    
# Line 97  for my $i ( 1 .. 3 ) { Line 97  for my $i ( 1 .. 3 ) {
97    
98  }  }
99    
 diag "multiple read-write";  
100    
101  ok( my $fh1 = IO::File->new("> $to/m"), 'open 1' );  sub multiple_rw {
102  $fh1->autoflush;  
103  ok( print($fh1 "1.1\n"), 'print 1.1' );          diag "multiple read-write";
104  ok( my $fh2 = IO::File->new(">> $to/m"), 'open 2' );          ok( my $fh1 = IO::File->new("> $to/m"), 'open 1' );
105  $fh2->autoflush;          $fh1->autoflush;
106  ok( print($fh2 "2.1\n"), 'print 2.1' );          ok( print($fh1 "1.1\n"), 'print 1.1' );
107  cmp_ok( read_file("$to/m"), 'eq', "1.1\n2.1\n", 'mixed' );          ok( my $fh2 = IO::File->new(">> $to/m"), 'open 2' );
108  ok( print($fh1 "1.2\n"), 'print 1.2' );          $fh2->autoflush;
109  cmp_ok( read_file("$to/m"), 'eq', "1.1\n1.2\n", 'just 1' );          ok( print($fh2 "2.1\n"), 'print 2.1' );
110            cmp_ok( read_file("$to/m"), 'eq', "1.1\n2.1\n", 'mixed' );
111            ok( print($fh1 "1.2\n"), 'print 1.2' );
112            cmp_ok( read_file("$to/m"), 'eq', "1.1\n1.2\n", 'just 1' );
113            dump_debug 'own twice';
114            ok( print($fh1 "x" x 65535), 'print 1 64k' );
115            ok( close($fh1), 'close 1' );
116            dump_debug 'own once';
117            ok( close($fh2), 'close 2' );
118            dump_debug 'closed';
119    
120    }
121    
122    multiple_rw;
123    multiple_rw;
124    
125    

Legend:
Removed from v.12  
changed lines
  Added in v.13

  ViewVC Help
Powered by ViewVC 1.1.26