issue45.t 971 B

123456789101112131415161718192021222324252627282930
  1. #! /usr/bin/env perl
  2. # http://code.google.com/p/perl-compiler/issues/detail?id=45
  3. # dorassign //= failed until B::CC 1.09 (B-C-1.30)
  4. BEGIN {
  5. unless (-d ".git" and !$ENV{NO_AUTHOR}) {
  6. print "1..0 #SKIP Only if -d .git\n"; exit;
  7. }
  8. }
  9. use Test::More tests => 4;
  10. use strict;
  11. BEGIN {
  12. unshift @INC, 't';
  13. require "test.pl";
  14. }
  15. use B::CC;
  16. SKIP: {
  17. skip "dorassign was added with perl 5.10.0", 4 if $] < 5.010;
  18. # other: define it
  19. ctestok(1, "CC", "ccode45i", 'my $x; $x//=1; print q(ok) if $x;',
  20. ($B::CC::VERSION < 1.09 ? "TODO " : ""). "dorassign other fixed with B-C-1.30");
  21. # next: already defined
  22. ctestok(2, "CC", "ccode45i", 'my $x=1; $x//=0; print q(ok) if $x;',
  23. ($B::CC::VERSION < 1.09 ? "TODO " : ""). "dorassign next fixed with B-C-1.30");
  24. # dor never failed but test it here for regressions
  25. ctestok(3, "CC", "ccode45i", 'my ($x,$y); $x=$y//1;print "ok" if $x;');
  26. ctestok(4, "CC", "ccode45i", 'my $y=1; my $x=$y//0;print "ok" if $x;');
  27. }