PageRenderTime 55ms CodeModel.GetById 28ms RepoModel.GetById 0ms app.codeStats 0ms

/t/issue38.t

https://code.google.com/
Perl | 22 lines | 16 code | 2 blank | 4 comment | 3 complexity | fbfc80a1cde01ebbf1427c5ae6821881 MD5 | raw file
Possible License(s): AGPL-1.0
  1. #! /usr/bin/env perl
  2. # http://code.google.com/p/perl-compiler/issues/detail?id=38
  3. # $x = $x || 3 didn't work with B::CC
  4. use Test::More tests => 1;
  5. use strict;
  6. BEGIN {
  7. unshift @INC, 't';
  8. require "test.pl";
  9. }
  10. # we should return the value (2) not just 0/1 (false/true)
  11. my $script = <<'EOF';
  12. my $x = 2;
  13. $x = $x || 3;
  14. print "ok\n" if $x == 2;
  15. EOF
  16. use B::CC;
  17. ctestok(1, "CC", "ccode38i", $script,
  18. $B::CC::VERSION < 1.08
  19. ? "TODO B::CC issue 38 fixed with B-C-1.28 r559 (B::CC 1.08) by Heinz Knutzen"
  20. : 'CC $x = $x || 3 should return the value not return true/false');