OILS / spec / ysh-tuple.test.sh View on Github | oilshell.org

28 lines, 9 significant
1## our_shell: ysh
2## oils_failures_allowed: 1
3
4#### tuple literal and (( conflict
5if ((0,0) < (0,1)) { echo yes }
6## STDOUT:
7yes
8## END
9
10#### Empty tuple
11var t = ()
12echo length=$[len(t)]
13## STDOUT:
14length=0
15## END
16
17#### Singleton tuple should be empty list
18
19var t = [42]
20echo len=$[len(t)]
21
22#var t1 = 1,
23var t2 = (42,)
24
25## status: 2
26## STDOUT:
27len=1
28## END