commit d91f06758e28b8208633146ed0397bcc8104f5a6
Author: James E Keenan <jkeenan@cpan.org>
Date: Sun Oct 13 09:40:09 2013 -0400
Add test demonstrating that CPAN #51491 has been fixed.
For:
https://rt.cpan.org/Ticket/Display.html?id=51491
diff --git a/t/24_misc.t b/t/24_misc.t
index ff210f1..23ffc72 100644
--- a/t/24_misc.t
+++ b/t/24_misc.t
@@ -9,7 +9,7 @@ BEGIN {
use File::Spec::Functions ':ALL';
use t::lib::Test;
-use Test::More qw(no_plan); # tests => 24;;
+use Test::More tests => 22;;
use YAML::Tiny;
use File::Temp qw(tempfile);
@@ -127,4 +127,16 @@ use File::Temp qw(tempfile);
qr/YAML::Tiny failed to classify line '$str'/,
"Correctly failed to load non-YAML string"
);
+ $YAML::Tiny::errstr = '';
+}
+
+{
+ my ($obj, $str, $yaml, $file);
+ $obj = YAML::Tiny->new();
+ isa_ok( $obj, 'YAML::Tiny' );
+ $file = catfile( test_data_directory(), '51491_space_after_hyphen.yml' );
+ eval { $yaml = $obj->read($file); };
+ ok(! YAML::Tiny->errstr, "\$obj->read: No error; CPAN #51491 is fixed");
+ isa_ok( $yaml, 'YAML::Tiny' );
+ $YAML::Tiny::errstr = '';
}
diff --git a/t/data/51491_space_after_hyphen.yml b/t/data/51491_space_after_hyphen.yml
new file mode 100644
index 0000000..063c1e2
--- /dev/null
+++ b/t/data/51491_space_after_hyphen.yml
@@ -0,0 +1,4 @@
+---
+FOO:
+ -
+ bar: baz