File: svk.t

package info (click to toggle)
libyaml-perl 1.31-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 672 kB
  • sloc: perl: 2,294; makefile: 2
file content (20 lines) | stat: -rw-r--r-- 564 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use strict;
my $t; use lib ($t = -e 't' ? 't' : 'test');
use TestYAML tests => 3;

my $test_file = "$t/svk-config.yaml";
my $node = LoadFile($test_file);

is ref($node), 'HASH',
    "loaded svk file is a hash";

open IN, $test_file or die "Can't open $test_file for input: $!";
my $yaml_from_file = do {local $/; <IN>};

like $yaml_from_file, qr{^---\ncheckout: !perl/Data::Hierarchy\n},
    "at least first two lines of file are right";

my $yaml_from_node = Dump($node);

is Dump(Load($yaml_from_node)), Dump(Load($yaml_from_file)),
    "svk data roundtrips!";;