File: schema-ixhash.pm

package info (click to toggle)
libyaml-pp-perl 0.39.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,636 kB
  • sloc: perl: 14,462; makefile: 15
file content (71 lines) | stat: -rw-r--r-- 1,065 bytes parent folder | download | duplicates (3)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/usr/bin/env perl
use strict;
use warnings;

### TEST DATA ###

my %tests = (

### - Ordered Hashref (Tie::IxHash)
    order => [
        <<'EOM',
        tie(my %order, 'Tie::IxHash');
        %order = (
            U => 2,
            B => 52,
            c => 64,
            19 => 84,
            Disco => 2000,
            Year => 2525,
            days_on_earth => 20_000,
        );
        \%order;
EOM
        <<'EOM',
---
- &1
  U: 2
  B: 52
  c: 64
  19: 84
  Disco: 2000
  Year: 2525
  days_on_earth: 20000
- *1
EOM
    ],

### - Blessed Ordered Hashref
    order_blessed => [
        <<'EOM',
        tie(my %order, 'Tie::IxHash');
        %order = (
            U => 2,
            B => 52,
            c => 64,
            19 => 84,
            Disco => 2000,
            Year => 2525,
            days_on_earth => 20_000,
        );
        bless \%order, 'Order';
EOM
        <<'EOM',
---
- &1 !perl/hash:Order
  U: 2
  B: 52
  c: 64
  19: 84
  Disco: 2000
  Year: 2525
  days_on_earth: 20000
- *1
EOM
    ],

);

### TEST DATA END ###

\%tests;