Skip Menu |

This queue is for tickets about the YAML-Tiny CPAN distribution.

Report information
The Basics
Id: 51491
Status: resolved
Priority: 0/
Queue: YAML-Tiny

People
Owner: jkeenan [...] cpan.org
Requestors: hiroaki.kubota [...] mail.rakuten.co.jp
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.40
Fixed in: (no value)



Subject: read() failed with 'YAML::Tiny found bad indenting in line...' when array parsing
YAML::Tiny->read("foo.yaml"); returned error when parsing the next file. *** foo.yaml *** --- FOO: - <= There is a space after '-' !! bar: baz **************** I maybe found bug of the regular expression by (Tiny.pm:259). *** Origin **** } elsif ( $lines->[0] =~ /^\s*\-(\s*)(.+?)\s*\z/ ) { *** Should be **** } elsif ( $lines->[0] =~ /^\s*\-(\s*)([\S]+?)\s*\z/ ) { Thank you.
On Fri Nov 13 04:13:18 2009, hirkubota wrote: Show quoted text
> YAML::Tiny->read("foo.yaml"); returned error when parsing the next file. > > *** foo.yaml *** > --- > FOO: > - <= There is a space after '-' !! > bar: baz > **************** > > I maybe found bug of the regular expression by (Tiny.pm:259). > > *** Origin **** > } elsif ( $lines->[0] =~ /^\s*\-(\s*)(.+?)\s*\z/ ) { > *** Should be **** > } elsif ( $lines->[0] =~ /^\s*\-(\s*)([\S]+?)\s*\z/ ) { > > Thank you.
I believe this has been fixed at HEAD in master. Can one of the other committers review the patch attached? Thank you very much. Jim Keenan
Subject: 51491.patch
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
On Sun Oct 13 09:49:32 2013, JKEENAN wrote: Show quoted text
> On Fri Nov 13 04:13:18 2009, hirkubota wrote:
> > YAML::Tiny->read("foo.yaml"); returned error when parsing the next file.
[snip] Show quoted text
> > I believe this has been fixed at HEAD in master. > > Can one of the other committers review the patch attached? > > Thank you very much. > Jim Keenan
No comments received. Applied to master. commit 274aba7aa63306537017539bc1a2edd9a934eea8 Author: James E Keenan <jkeenan@cpan.org> AuthorDate: Mon Oct 21 21:37:51 2013 -0400 Commit: James E Keenan <jkeenan@cpan.org> CommitDate: Mon Oct 21 21:37:51 2013 -0400 Add test demonstrating that CPAN #51491 has been fixed. For: https://rt.cpan.org/Ticket/Display.html?id=51491