issue159.t 781 B

123456789101112131415161718192021
  1. #! /usr/bin/env perl
  2. # http://code.google.com/p/perl-compiler/issues/detail?id=159
  3. # wrong ISA with empty packages, and wrong dumping of unfound methods
  4. use Test::More tests => 2;
  5. use strict;
  6. BEGIN {
  7. unshift @INC, 't';
  8. require "test.pl";
  9. }
  10. use B::C;
  11. my $when = "1.42_61";
  12. ctestok(1, "C,-O3", 'ccode159i_c',
  13. 'BEGIN{@X::ISA="Y";sub Y::z{"Y::z"}} print "ok\n" if X->z eq "Y::z";delete $X::{z};exit',
  14. ($B::C::VERSION lt $when ? "TODO " : "").
  15. "wrong ISA with empty packages fixed with B-C-$when");
  16. ctestok(2, "C,-O3", 'ccode159i_r',
  17. '@X::ISA="Y";sub Y::z{"Y::z"} print "ok\n" if X->z eq "Y::z";delete $X::{z};exit',
  18. ($B::C::VERSION lt $when ? "TODO " : "").
  19. "wrong method dispatch by dumping unfound methods fixed with B-C-$when");