2 use test::helper qw($_real $_point);
7 undef $/; # slurp it all
9 system("echo frogbing >writefile");
11 # fetch contents of file
12 ok(open(FILE,"writefile"),"open");
15 is(length($data),9,"right amount read");
16 is($data,"frogbing\n","right data read");
19 ok(open(FILE,'+<',"writefile"),"open");
20 ok(seek(FILE,2,0),"seek");
21 ok(print(FILE "ib"),"print");
24 # fetch contents of file
25 ok(open(FILE,"writefile"),"open");
28 is(length($data),9,"right amount read");
29 is($data,"fribbing\n","right data read");
31 # overwrite part, append some
32 ok(open(FILE,'+<',"writefile"),"open");
33 ok(seek(FILE,7,0),"seek");
34 ok(print(FILE "gle"),"print");
37 # fetch contents of file
38 ok(open(FILE,"writefile"),"open");
41 is(length($data),10,"right amount read");
42 is($data,"fribbingle","right data read");