issue203.t 688 B

12345678910111213141516171819202122232425
  1. #! /usr/bin/env perl
  2. # http://code.google.com/p/perl-compiler/issues/detail?id=203
  3. # perlio layers via use open attributes not stored
  4. BEGIN {
  5. unless (-d '.git') {
  6. print "1..0 #SKIP Only if -d .git\n";
  7. exit;
  8. }
  9. unshift @INC, 't';
  10. require "test.pl";
  11. }
  12. use strict;
  13. use Test::More tests => 1;
  14. use B::C ();
  15. #my $when = "1.46";
  16. #my $todo = ($B::C::VERSION lt $when ? "TODO " : "");
  17. my $todo = "TODO ";
  18. ctestok(1,'C,-O0','ccode203i',<<'EOF',$todo.'#203 restore compile-time perlio layers via use open');
  19. use open(IN => ":crlf", OUT => ":encoding(cp1252)");
  20. open F, "<", "/dev/null";
  21. my %l = map {$_=>1} PerlIO::get_layers(F, input => 1);
  22. print $l{crlf} ? q(ok) : keys(%l);
  23. EOF