summaryrefslogtreecommitdiff
path: root/t/svk.t
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2015-04-18 15:03:28 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2015-04-18 15:03:28 +0000
commit2fe5b8de1e9d06482aa76303e7342bc6605700ea (patch)
treecccc47c409970b2db7a8f64f6c25e993270ddf9b /t/svk.t
downloadYAML-tarball-master.tar.gz
Diffstat (limited to 't/svk.t')
-rw-r--r--t/svk.t20
1 files changed, 20 insertions, 0 deletions
diff --git a/t/svk.t b/t/svk.t
new file mode 100644
index 0000000..d859ebc
--- /dev/null
+++ b/t/svk.t
@@ -0,0 +1,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!";;