]> mj.ucw.cz Git - libucw.git/blob - lib/shell/config.t
b28bd393d0a7015ffdc0a166a248d888413d9e49
[libucw.git] / lib / shell / config.t
1 # Tests for configuration parser
2
3 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}'
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_sec2_str3=''
10
11 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}}'
12 Out:    CF_sec1_list1_int1[0]='2'
13         CF_sec1_list1_str1[0]='a2'
14         CF_sec1_list1_int1[1]='3'
15         CF_sec1_list1_str1[1]='a3'
16
17 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}}}'
18 Out:    CF_sec1_list1_str1[0]='1'
19         CF_sec1_list1_list2_str2[0]='a'
20         CF_sec1_list1_list2_str2[1]='b'
21         CF_sec1_list1_list2_str2[2]='c'
22         CF_sec1_list1_str1[1]='2'
23         CF_sec1_list1_list2_str2[3]='d'
24         CF_sec1_list1_list2_str2[4]='e'
25
26 Run:    obj/lib/shell/config -C/dev/null 'sec{str=a'\''b"c'\''d"\\e'\''f"g}'
27 Out:    CF_sec_str='ab"cd\e'\''fg'