Skip Menu |
 

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

Report information
The Basics
Id: 56045
Status: open
Worked: 20 min
Priority: 0/
Queue: YAML-Tiny

People
Owner: Nobody in particular
Requestors: ben [...] morrow.me.uk
Cc:
AdminCc:

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



Subject: YAML::Tiny strips space after newline in verb blocks
Date: Mon, 29 Mar 2010 10:11:26 +0100
To: bug-YAML-Tiny [...] rt.cpan.org
From: Ben Morrow <ben [...] morrow.me.uk>
Download (untitled) / with headers
text/plain 312b
YAML::Tiny 1.41 appears to strip any space after a newline in verbatim blocks (blocks initiated with '|'). See the attached test. It would be somewhat reasonable for YAML::Tiny to not implement | blocks at all, but it should give an error rather than incorrect data. This is with perl 5.10.1 on FreeBSD. Ben
Download yamltinybug
text/plain 246b
#!/usr/bin/perl use Test::More tests => 1; use YAML::Tiny qw/Load/; my $str = <<STR; one two three STR (my $indent = $str) =~ s/^/ /mg; my $yaml = Load <<YAML; foo: | $indent YAML is $yaml->{foo}, $str, "Verbatim text isn't corrupted";
Download (untitled) / with headers
text/plain 930b
On Mon Mar 29 05:11:43 2010, ben@morrow.me.uk wrote: Show quoted text
> YAML::Tiny 1.41 appears to strip any space after a newline in verbatim > blocks (blocks initiated with '|'). See the attached test. > > It would be somewhat reasonable for YAML::Tiny to not implement | blocks > at all, but it should give an error rather than incorrect data. > > This is with perl 5.10.1 on FreeBSD. > > Ben >
Confirmed. Here is the output I got: ##### 56045-verbatim.t .. 1..1 not ok 1 - Verbatim text isn't corrupted # Failed test 'Verbatim text isn't corrupted' # at 56045-verbatim.t line 19. # got: 'one # two # three # ' # expected: 'one # # two # three # ' # Looks like you failed 1 test of 1. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/1 subtests ########## The YAML::Tiny specification in the docs indicates this is required to work: ######### Support for the "|" literal block indicator is required. #########


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.