1 #### Shell Append += with Oil Values (issue #840)
2
3 var g = 2
4 echo g=$g
5
6 # What should happen here?
7
8 g+=1
9 echo g=$g
10
11 g+=1
12 echo g=$g
13
14 ## STDOUT:
15 ## END
16
17
18 #### Shell ${x:-default} with Oil values (issue #954)
19
20 var mylist = [1, 2, 3]
21
22 echo mylist ${mylist:-default}
23
24 var myint = 42
25
26 echo myint ${myint:-default}
27
28 ## STDOUT:
29 ## END
30
31
32 #### Shell ${a[0]} with Oil values (issue #1092)
33
34 var a = [1, 2, 3]
35 echo first ${a[0]}
36
37 ## STDOUT:
38 ## END
39
40
41 #### Splice nested List
42
43 var mylist = ["ls", {name: 42}]
44
45 # What should happen here? I think it should be an error
46 @mylist
47
48 ## STDOUT:
49 ## END
50
51 #### Splice nested Dict
52
53 var d ={name: [1, 2, 3]}
54 echo ${d[@]}
55
56 ## STDOUT:
57 ## END
58
59
60 #### Concatenate shell arrays and ${#a}
61
62 var a = %(a)
63 var b = %(b)
64
65 echo "len a ${#a[@]}"
66 echo "len b ${#b[@]}"
67
68 pp cell a
69
70 var c = a ++ b
71 pp cell c # shouldn't be value.Obj!
72
73 echo ${#c[@]}
74
75 ## STDOUT:
76 ## END
77