issue340.t 875 B

1234567891011121314151617181920212223242526
  1. #! /usr/bin/env perl
  2. # http://code.google.com/p/perl-compiler/issues/detail?id=340
  3. # SUPER on run-time loaded IO::Socket does not find compiled IO::Handle->autoflush
  4. # major walker rewrite
  5. # also test that -O3 warnings will not crash when being written to at run-time
  6. use strict;
  7. BEGIN {
  8. unshift @INC, 't';
  9. require "test.pl";
  10. }
  11. use Test::More;
  12. unless (eval{require Net::DNS;} and eval{require IO::Socket::INET6;}) {
  13. plan skip_all => "require Net::DNS and IO::Socket::INET6";
  14. exit(0);
  15. }
  16. plan tests => 1;
  17. # TODO: still prints compile-time Carp reloading cruft
  18. ctestok(1, 'C,-O3', 'ccode340i', <<'EOF', 'C #340 inc cleanup');
  19. eval q/use Net::DNS/;
  20. my $new = "IO::Socket::INET6"->can("new") or die "die at new";
  21. my $inet = $new->("IO::Socket::INET6", LocalAddr => q/localhost/, Proto => "udp", LocalPort => undef);
  22. print q(ok) if ref($inet) eq "IO::Socket::INET6";
  23. EOF