Subject: | Dies on read for hash keys containing spaces |
Doesn't handle hash keys with spaces in on read. See failing test attached.
Not sure if fixing this fits within the remit of the "tiny" philosophy. If not maybe an error on
write would be nice so at least the read/write is symmetric.
Subject: | yaml.pl |
#! /usr/bin/perl
use strict;
use warnings;
use YAML::Tiny;
use YAML;
use Test::More tests => 1;
my $test_description = 'got correct from key with space';
my ( $key, $value ) = ( "the key", "the value" );
my $writer = YAML::Tiny->new;
$writer->[0]->{ $key } = $value;
eval {
my $reader = YAML::Tiny->read_string( $writer->write_string );
is $reader->[0]->{ $key }, $value, $test_description;
}; if (my $e = $@) {
fail $test_description; diag $e
}