File: glob.t

package info (click to toggle)
libdata-dump-perl 1.25-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 188 kB
  • sloc: perl: 1,173; makefile: 2
file content (35 lines) | stat: -rw-r--r-- 708 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!perl -w

use strict;
use Test qw(plan ok);
plan tests => 6;

use Data::Dump qw(dump);
use Symbol qw(gensym);

ok(dump(*STDIN), "*main::STDIN");
ok(dump(\*STDIN), "\\*main::STDIN");
ok(dump(gensym()), "do {\n  require Symbol;\n  Symbol::gensym();\n}");

$a = [];
${*foo}[1] = $a;
${*foo}{bar} = 2;
ok(dump(\*foo, $a) . "\n", <<'EOT');
do {
  my $a = \*main::foo;
  *{$a} = [undef, []];
  *{$a} = { bar => 2 };
  ($a, *{$a}{ARRAY}[1]);
}
EOT

use IO::Socket::INET;
my $s = IO::Socket::INET->new(
    Listen => 1,
    Timeout => 5,
    LocalAddr => '127.0.0.1',
);
$s = dump($s);
print "$s\n";
ok($s =~ /my \$a = bless\(Symbol::gensym\(\), "IO::Socket::INET"\);/);
ok($s =~ /^\s+io_socket_timeout\s+=> 5,/m);