issue259.t 564 B

123456789101112131415161718192021222324
  1. #! /usr/bin/env perl
  2. # http://code.google.com/p/perl-compiler/issues/detail?id=259
  3. # enforce atttrbutes to be loaded before JSON::XS
  4. use strict;
  5. BEGIN {
  6. unshift @INC, 't';
  7. require "test.pl";
  8. }
  9. use Test::More;
  10. eval "use JSON::XS;";
  11. if ($@) {
  12. plan skip_all => "JSON::XS required for testing issue259" ;
  13. } else {
  14. plan tests => 1;
  15. }
  16. use B::C ();
  17. my $todo = ($B::C::VERSION ge '1.43_02' or $] < 5.009) ? "" : "TODO ";
  18. ctestok(1,'C,-O3','ccode259i',<<'EOF',$todo.'attributes load-order #259');
  19. use JSON::XS;
  20. print q(ok) if q([false]) eq encode_json([\0]);
  21. EOF