OILS / spec / zsh-idioms.test.sh View on Github | oilshell.org

45 lines, 13 significant
1## compare_shells: bash zsh mksh
2
3#### git-completion snippet
4
5# copied directly from git completion - 2024-04
6
7if false; then
8 unset ${(M)${(k)parameters[@]}:#__gitcomp_builtin_*} 2>/dev/null
9fi
10echo status=$?
11
12## STDOUT:
13status=0
14## END
15
16#### asdf snippet
17
18# copied directly from asdf - 2024-04
19
20if false; then
21 ASDF_DIR=${(%):-%x}
22fi
23
24## STDOUT:
25## END
26
27#### zsh var sub is rejected at runtime
28
29echo z ${(m)foo} z
30echo status=$?
31
32## status: 1
33## STDOUT:
34## END
35
36## OK zsh status: 0
37## OK zsh STDOUT:
38z z
39status=0
40## END
41
42## OK bash status: 0
43## OK bash STDOUT:
44status=1
45## END