# HG changeset patch # User sergey # Date 1317817425 -14400 # Node ID 74c27daf2e7ba91c8cb5a43446b6835fcac68cf3 # Parent 9057e4b95d1025788d0d163612ad4e3c3392b6ba minor changes diff -r 9057e4b95d10 -r 74c27daf2e7b Lib/IMPL/lang.pm --- a/Lib/IMPL/lang.pm Wed Oct 05 00:48:43 2011 +0300 +++ b/Lib/IMPL/lang.pm Wed Oct 05 16:23:45 2011 +0400 @@ -53,6 +53,7 @@ &hashMerge &hashDiff &hashCompare + &hashParse ) ] ); diff -r 9057e4b95d10 -r 74c27daf2e7b _test/Test/Lang.pm --- a/_test/Test/Lang.pm Wed Oct 05 00:48:43 2011 +0300 +++ b/_test/Test/Lang.pm Wed Oct 05 16:23:45 2011 +0400 @@ -93,4 +93,17 @@ }; +test hashParse => sub { + my $res = hashParse("a = test a\nb = test b\nc c=test c"); + + assert($res->{a} eq "test a"); + assert($res->{b} eq "test b"); + assert($res->{"c c"} eq "test c"); + + $res = hashParse("a:b, c: d",qr/\s*:\s*/,qr/\s*,\s*/); + + assert($res->{a} eq "b"); + assert($res->{c} eq "d"); +}; + 1; \ No newline at end of file