File: private.t

package info (click to toggle)
libyaml-libyaml-perl 0.76%2Brepack-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 688 kB
  • sloc: perl: 1,603; ansic: 1,140; sh: 29; makefile: 4
file content (17 lines) | stat: -rw-r--r-- 446 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use FindBin '$Bin';
use lib $Bin;
use TestYAMLTests tests => 6;

my $a = Load(<<'...');
---
- !foo [1]
- !Bar::Bar {fa: la}
- !only lonely
...

is ref($a), 'ARRAY', 'Load worked';
is ref($a->[0]), 'foo', 'Private tag works for array';
is ref($a->[1]), 'Bar::Bar', 'Private tag works for hash';
is ref($a->[2]), 'only', 'Private tag works for scalar';
is ${$a->[2]}, 'lonely', 'Scalar is correct';
like $a->[2], qr/^only=SCALAR/, 'Ref is SCALAR';