5 use File::Temp qw(tempfile);
8 my $tmpfh = tempfile();
15 plan skip_all => 'Truncate not implemented on this system';
21 my $can_truncate_stdout = truncate(\*STDOUT,0);
23 if ($can_truncate_stdout) {
24 skip("This system thinks we can truncate STDOUT. Suuure!", 1);
32 isa_ok($@, 'autodie::exception', "Truncating STDOUT should throw an exception");
42 isa_ok($@, 'autodie::exception', "Truncating an unopened file is wrong.");
44 $tmpfh->print("Hello World");
52 is($@, "", "Truncating a normal file should be fine");