]> mj.ucw.cz Git - libucw.git/blob - ucw/shell/config.t
tableprinter: update of tests
[libucw.git] / ucw / shell / config.t
1 # Tests for configuration parser
2
3 Run:    ../obj/ucw/shell/ucw-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}'
4 Out:    CF_sec1_int1='23'
5         CF_sec1_long1='1234567812345678'
6         CF_sec1_str2='s2'
7         CF_sec1_int2='123'
8         CF_sec1_long2='4321'
9         CF_sec1_int3='16'
10         CF_sec1_int4='0'
11         CF_sec1_dbl1='1.1'
12         CF_sec1_dbl2='0'
13         CF_sec2_str3=''
14
15 Run:    ../obj/ucw/shell/ucw-config -C/dev/null -S 'sec1{list1 1 a1 b1; list1:clear; list1 2 a2 b2 3 a3 b3}' 'sec1 {@list1 {#int1; str1; -str2}}'
16 Out:    CF_sec1_list1_int1[1]='2'
17         CF_sec1_list1_str1[1]='a2'
18         CF_sec1_list1_int1[2]='3'
19         CF_sec1_list1_str1[2]='a3'
20
21 Run:    ../obj/ucw/shell/ucw-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]}'
22 Out:    CF_sec1_ar1[1]='a'
23         CF_sec1_ar1[2]='b'
24         CF_sec1_ar1[3]='c'
25         CF_sec1_ar2[1]='1'
26         CF_sec1_ar2[2]='2'
27         CF_sec1_ar3[1]='1.1'
28
29 Run:    ../obj/ucw/shell/ucw-config -C/dev/null -S 'sec1{list1 {str1=1; list2=a b c}; list1 {str1=2; list2=d e}}' 'sec1 {@list1 {str1; @list2{str2}}}'
30 Out:    CF_sec1_list1_str1[1]='1'
31         CF_sec1_list1_list2_str2[1]='a'
32         CF_sec1_list1_list2_str2[2]='b'
33         CF_sec1_list1_list2_str2[3]='c'
34         CF_sec1_list1_str1[2]='2'
35         CF_sec1_list1_list2_str2[4]='d'
36         CF_sec1_list1_list2_str2[5]='e'
37
38 Run:    ../obj/ucw/shell/ucw-config -C/dev/null 'sec{str=a'\''b"c'\''d"\\e'\''f"g}'
39 Out:    CF_sec_str='ab"cd\e'\''fg'