issue148.t 690 B

123456789101112131415161718192021222324252627
  1. #! /usr/bin/env perl
  2. # http://code.google.com/p/perl-compiler/issues/detail?id=148
  3. # Opening Bareword Filehandles for Writing does not work
  4. use Test::More tests => 2;
  5. use strict;
  6. BEGIN {
  7. unshift @INC, 't';
  8. require "test.pl";
  9. }
  10. # failed 5.10 only (B::FM object for GvFORM)
  11. #my $todo = ($] =~ /^5\.010/) ? "TODO " : "";
  12. my $todo = ""; # fixed with 1.45_08
  13. my $tmp = "ccode148i.tmp";
  14. ctestok(1, "C,-O3", 'ccode148i', '$tmp="ccode148i.tmp";open(FH,">",$tmp);print FH "1\n";close FH;print "ok" if -s $tmp', "#148 bareword IO") and unlink $tmp;
  15. ctestok(2, "C,-O3", 'ccode149i', <<'EOF', $todo.'#149 format with bareword IO');
  16. format Comment =
  17. ok
  18. .
  19. {
  20. local $~ = "Comment";
  21. write;
  22. }
  23. EOF