1 # For OSH only functionality
2
3 #### var x = $(echo bad; false) in OSH
4
5 #shopt -s verbose_errexit
6
7 # This turns on command_sub_errexit and fails
8 var x = $(echo bad; false)
9 echo 'unreachable'
10
11 pp test_ (x)
12
13 ## status: 1
14 ## STDOUT:
15 ## END
16
17
18 #### var x = $(echo one; false; echo two) in OSH
19
20 #shopt -s verbose_errexit
21
22 # I don't understand why this doesn't fail
23 var x = $(echo one; false; echo two)
24 echo 'unreachable'
25
26 pp test_ (x)
27
28 ## status: 1
29 ## STDOUT:
30 ## END
31
32
33 #### YSH $[expr_sub] in OSH should not do dynamic globbing
34
35 touch {foo,bar}.txt
36
37 shopt -s parse_ysh_expr_sub
38 echo $["*.txt"]
39
40 ## STDOUT:
41 *.txt
42 ## END
43
44
45 #### SHELLOPTS bug with ysh:ugprade
46
47 cd $REPO_ROOT/spec/testdata/bug-shellopts
48
49 #shopt -p no_init_globals
50
51 $SH -o ysh:upgrade ./top-level.ysh
52
53 #echo ---
54 #$SH -e -c 'echo SHELLOPTS=$SHELLOPTS'
55 #$SH -e -o ysh:upgrade -c 'echo SHELLOPTS=$SHELLOPTS'
56
57 ## STDOUT:
58 1
59 a
60 b
61 .
62 ..
63 2
64 ## END