changeset 176:74c27daf2e7b

minor changes
author sergey
date Wed, 05 Oct 2011 16:23:45 +0400
parents 9057e4b95d10
children df71a307ef9b
files Lib/IMPL/lang.pm _test/Test/Lang.pm
diffstat 2 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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
 		  )
 	]
 );
--- 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