issue45.t 865 B

12345678910111213141516171819202122232425
  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. use Test::More tests => 4;
  5. use strict;
  6. BEGIN {
  7. unshift @INC, 't';
  8. require "test.pl";
  9. }
  10. use B::CC;
  11. SKIP: {
  12. skip "dorassign was added with perl 5.10.0", 4 if $] < 5.010;
  13. # other: define it
  14. ctestok(1, "CC", "ccode45i", 'my $x; $x//=1; print q(ok) if $x;',
  15. ($B::CC::VERSION < 1.09 ? "TODO " : ""). "dorassign other fixed with B-C-1.30");
  16. # next: already defined
  17. ctestok(2, "CC", "ccode45i", 'my $x=1; $x//=0; print q(ok) if $x;',
  18. ($B::CC::VERSION < 1.09 ? "TODO " : ""). "dorassign next fixed with B-C-1.30");
  19. # dor never failed but test it here for regressions
  20. ctestok(3, "CC", "ccode45i", 'my ($x,$y); $x=$y//1;print "ok" if $x;');
  21. ctestok(4, "CC", "ccode45i", 'my $y=1; my $x=$y//0;print "ok" if $x;');
  22. }