use strict;
use warnings;
-use Encode qw(from_to);
use IO::Scalar;
use Test::More tests => 16;
run_test ($data, $expected);
+# In the next test, the value of ValueContainingEscapes in the
+# imported data is \\W\\, which will become \W\ in the final hive.
+# However Perl has complex and inconsistent rules on quoting
+# backslashes. See:
+# http://en.wikibooks.org/wiki/Perl_Programming/Strings#Single_Quoted_Strings
$data = '
[\A]
"NotExistant"=-
[\A\B]
"Key\"Containing\"Quotes"=hex(0):
+"ValueContainingEscapes"="\\\\W\\\\"
';
$expected = '[\]
[\A\B]
"Key\"Containing\"Quotes"=hex(0):
+"ValueContainingEscapes"=hex(1):5c,00,57,00,5c,00,00,00
';
$data = '
[\A\B]
"Key\"Containing\"Quotes"=-
+"ValueContainingEscapes"=-
-[\A]
';