]> git.vpit.fr Git - perl/modules/autovivification.git/blob - t/23-hash-specific.t
Run t/23-hash-specific.t under taint mode
[perl/modules/autovivification.git] / t / 23-hash-specific.t
1 #!perl -T
2
3 use strict;
4 use warnings;
5
6 use Test::More tests => 6 * 3 * 56;
7
8 use lib 't/lib';
9 use autovivification::TestCases;
10
11 while (<DATA>) {
12  1 while chomp;
13  next unless /#/;
14  testcase_ok($_, '%');
15 }
16
17 __DATA__
18
19 --- keys ---
20
21 $x # keys %$x # '', 0, { }
22 $x # keys %$x # '', 0, undef #
23 $x # keys %$x # '', 0, undef # +fetch
24 $x # keys %$x # '', 0, { }   # +exists
25 $x # keys %$x # '', 0, { }   # +delete
26 $x # keys %$x # '', 0, { }   # +store
27
28 $x # keys %$x # qr/^Reference vivification forbidden/, undef, undef # +strict +fetch
29 $x # keys %$x # '', 0, { } # +strict +exists
30 $x # keys %$x # '', 0, { } # +strict +delete
31 $x # keys %$x # '', 0, { } # +strict +store
32
33 $x # [ keys %$x ] # '', [ ], { }
34 $x # [ keys %$x ] # '', [ ], undef #
35 $x # [ keys %$x ] # '', [ ], undef # +fetch
36 $x # [ keys %$x ] # '', [ ], { }   # +exists +delete +store
37
38 $x # keys %{$x->{a}} # '', 0, { a => { } }
39 $x # keys %{$x->{a}} # '', 0, undef        #
40 $x # keys %{$x->{a}} # '', 0, undef        # +fetch
41 $x # keys %{$x->{a}} # '', 0, { a => { } } # +exists
42 $x # keys %{$x->{a}} # '', 0, { a => { } } # +delete
43 $x # keys %{$x->{a}} # '', 0, { a => { } } # +store
44
45 $x # keys %{$x->{a}} # qr/^Reference vivification forbidden/, undef, undef # +strict +fetch
46 $x # keys %{$x->{a}} # '', 0, { a => { } } # +strict +exists
47 $x # keys %{$x->{a}} # '', 0, { a => { } } # +strict +delete
48 $x # keys %{$x->{a}} # '', 0, { a => { } } # +strict +store
49
50 $x # [ keys %{$x->{a}} ] # '', [ ], { a => { } }
51 $x # [ keys %{$x->{a}} ] # '', [ ], undef        #
52 $x # [ keys %{$x->{a}} ] # '', [ ], undef        # +fetch
53 $x # [ keys %{$x->{a}} ] # '', [ ], { a => { } } # +exists +delete +store
54
55 --- values ---
56
57 $x # values %$x # '', 0, { }
58 $x # values %$x # '', 0, undef #
59 $x # values %$x # '', 0, undef # +fetch
60 $x # values %$x # '', 0, { }   # +exists
61 $x # values %$x # '', 0, { }   # +delete
62 $x # values %$x # '', 0, { }   # +store
63
64 $x # values %$x # qr/^Reference vivification forbidden/, undef, undef # +strict +fetch
65 $x # values %$x # '', 0, { } # +strict +exists
66 $x # values %$x # '', 0, { } # +strict +delete
67 $x # values %$x # '', 0, { } # +strict +store
68
69 $x # [ values %$x ] # '', [ ], { }
70 $x # [ values %$x ] # '', [ ], undef #
71 $x # [ values %$x ] # '', [ ], undef # +fetch
72 $x # [ values %$x ] # '', [ ], { }   # +exists +delete +store
73
74 $x # values %{$x->{a}} # '', 0, { a => { } }
75 $x # values %{$x->{a}} # '', 0, undef        #
76 $x # values %{$x->{a}} # '', 0, undef        # +fetch
77 $x # values %{$x->{a}} # '', 0, { a => { } } # +exists
78 $x # values %{$x->{a}} # '', 0, { a => { } } # +delete
79 $x # values %{$x->{a}} # '', 0, { a => { } } # +store
80
81 $x # values %{$x->{a}} # qr/^Reference vivification forbidden/, undef, undef # +strict +fetch
82 $x # values %{$x->{a}} # '', 0, { a => { } } # +strict +exists
83 $x # values %{$x->{a}} # '', 0, { a => { } } # +strict +delete
84 $x # values %{$x->{a}} # '', 0, { a => { } } # +strict +store
85
86 $x # [ values %{$x->{a}} ] # '', [ ], { a => { } }
87 $x # [ values %{$x->{a}} ] # '', [ ], undef        #
88 $x # [ values %{$x->{a}} ] # '', [ ], undef        # +fetch
89 $x # [ values %{$x->{a}} ] # '', [ ], { a => { } } # +exists +delete +store