X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Fshell%2Fconfig.t;h=a8aeb7276c8924da78681e66077ab18154c128e6;hb=39d5e9acc6d93c07cbb408fe27144c8a485499ac;hp=b28bd393d0a7015ffdc0a166a248d888413d9e49;hpb=481e6b8e96e16e34c60928a1ba007e8766b2c0b1;p=libucw.git diff --git a/lib/shell/config.t b/lib/shell/config.t index b28bd393..a8aeb727 100644 --- a/lib/shell/config.t +++ b/lib/shell/config.t @@ -1,27 +1,39 @@ # Tests for configuration parser -Run: obj/lib/shell/config -C/dev/null -S 'sec1{int1=23; long1=1234567812345678; long2=4321; str1="s1"; str2="s2"}' 'sec1 {#int1; ##long1; -str1; str2; #int2=123; ##long2=1234}; sec2{str3}' +Run: ../obj/lib/shell/config -C/dev/null -S 'sec1{int1=23; long1=1234567812345678; long2=4321; str1="s1"; str2="s2"}' 'sec1 {#int1; ##long1; -str1; str2; #int2=123; ##long2=1234; #int3=0x10; #int4; $dbl1=001.100; $dbl2}; sec2{str3}' Out: CF_sec1_int1='23' CF_sec1_long1='1234567812345678' CF_sec1_str2='s2' CF_sec1_int2='123' CF_sec1_long2='4321' + CF_sec1_int3='16' + CF_sec1_int4='0' + CF_sec1_dbl1='1.1' + CF_sec1_dbl2='0' CF_sec2_str3='' -Run: obj/lib/shell/config -C/dev/null -S 'sec1{list1 1 a1 b1; list1:clear; list1 2 a2 b2 3 a3 b3}' 'sec1 {@list1 {#int1; str1; -str2}}' -Out: CF_sec1_list1_int1[0]='2' - CF_sec1_list1_str1[0]='a2' - CF_sec1_list1_int1[1]='3' - CF_sec1_list1_str1[1]='a3' +Run: ../obj/lib/shell/config -C/dev/null -S 'sec1{list1 1 a1 b1; list1:clear; list1 2 a2 b2 3 a3 b3}' 'sec1 {@list1 {#int1; str1; -str2}}' +Out: CF_sec1_list1_int1[1]='2' + CF_sec1_list1_str1[1]='a2' + CF_sec1_list1_int1[2]='3' + CF_sec1_list1_str1[2]='a3' -Run: obj/lib/shell/config -C/dev/null -S 'sec1{list1 {str1=1; list2=a b c}; list1 {str1=2; list2=d e}}' 'sec1 {@list1 {str1; @list2{str2}}}' -Out: CF_sec1_list1_str1[0]='1' - CF_sec1_list1_list2_str2[0]='a' - CF_sec1_list1_list2_str2[1]='b' - CF_sec1_list1_list2_str2[2]='c' - CF_sec1_list1_str1[1]='2' - CF_sec1_list1_list2_str2[3]='d' - CF_sec1_list1_list2_str2[4]='e' +Run: ../obj/lib/shell/config -C/dev/null -S 'sec1{ar1 a b c d; ar1 a b c; ar2 1 2; ar3 1.1}' 'sec1 {ar1[]; #ar2[2]; $ar3[-2]}' +Out: CF_sec1_ar1[1]='a' + CF_sec1_ar1[2]='b' + CF_sec1_ar1[3]='c' + CF_sec1_ar2[1]='1' + CF_sec1_ar2[2]='2' + CF_sec1_ar3[1]='1.1' -Run: obj/lib/shell/config -C/dev/null 'sec{str=a'\''b"c'\''d"\\e'\''f"g}' +Run: ../obj/lib/shell/config -C/dev/null -S 'sec1{list1 {str1=1; list2=a b c}; list1 {str1=2; list2=d e}}' 'sec1 {@list1 {str1; @list2{str2}}}' +Out: CF_sec1_list1_str1[1]='1' + CF_sec1_list1_list2_str2[1]='a' + CF_sec1_list1_list2_str2[2]='b' + CF_sec1_list1_list2_str2[3]='c' + CF_sec1_list1_str1[2]='2' + CF_sec1_list1_list2_str2[4]='d' + CF_sec1_list1_list2_str2[5]='e' + +Run: ../obj/lib/shell/config -C/dev/null 'sec{str=a'\''b"c'\''d"\\e'\''f"g}' Out: CF_sec_str='ab"cd\e'\''fg'