omega-mv
Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.
Brought by drakestapleton
omega-mv / tests / osh / bashdiff / cases.txt
| 1 | # omega#344 bash-differential cases. Grammar: see bashdiff.sh. Run: make osh-bash-diff |
| 2 | # exit with too many arguments: bash -c stops the whole string at the failed exit (status 1); a script file or stdin |
| 3 | # continues with the next line. |
| 4 | ### exit-many-c | c | match | |
| 5 | exit 1 2; echo after |
| 6 | echo next |
| 7 | ### exit-many-f | f | match | |
| 8 | exit 1 2; echo after |
| 9 | echo next |
| 10 | ### exit-many-s | s | match | |
| 11 | exit 1 2; echo after |
| 12 | echo next |
| 13 | ### exit-many-c-andor | c | match | |
| 14 | true && exit 1 2 || echo or; echo after |
| 15 | echo next |
| 16 | # An empty expansion before `export` does not make it the declaration builtin: A=$y is split like any argument. |
| 17 | ### export-after-empty-word | c | match | |
| 18 | y="a b"; e=; $e export A=$y; echo "[$A]" |
| 19 | ### export-quoted-name | c | match | |
| 20 | y="a b"; "export" A=$y; echo "[$A]" |
| 21 | ### export-plain | c | match | |
| 22 | y="a b"; export A=$y; echo "[$A]" |
| 23 | ### export-after-redirect | c | match | |
| 24 | y="a b"; >/dev/null export A=$y; echo "[$A]" |
| 25 | # bash puts _=<full path of the program> into each child's environment. |
| 26 | ### underscore-child-env | c | match | |
| 27 | env | grep '^_=' |
| 28 | ### underscore-printenv | c | match | |
| 29 | printenv _ |
| 30 | ### underscore-inherited | c | match | |
| 31 | _=/x/y env | grep '^_=' |
| 32 | ### underscore-param | c | refuse=SPECIAL_PARAM | |
| 33 | echo hi > f; echo $_ |
| 34 | # pwd and cd .. after the working directory was removed while reached through a symlink. |
| 35 | ### pwd-removed-cwd-logical | c | match | |
| 36 | mkdir real; ln -s real lnk |
| 37 | %% |
| 38 | cd lnk; rmdir ../real; pwd; echo "rc=$?" |
| 39 | ### pwd-removed-cwd-physical | c | match | |
| 40 | mkdir real; ln -s real lnk |
| 41 | %% |
| 42 | cd lnk; rmdir ../real; pwd -P; echo "rc=$?" |
| 43 | ### cd-dotdot-removed-cwd | c | match | |
| 44 | mkdir real; ln -s real lnk |
| 45 | %% |
| 46 | cd lnk; rmdir ../real; cd ..; echo "rc=$?"; pwd; ls |
| 47 | # stderr wording of builtin errors. |
| 48 | ### export-bad-name | c | match | |
| 49 | export 1x=2; echo "rc=$?" |
| 50 | ### printf-no-format | c | match | |
| 51 | printf; echo "rc=$?" |
| 52 | ### unset-bad-option | c | match | |
| 53 | unset -x; echo "rc=$?" |
| 54 | # Builtin option and operand diagnostics (bash 5.2.21 wording, status 2 for an invalid option). |
| 55 | ### cd-bad-option | c | match | |
| 56 | cd -x; echo "rc=$?" |
| 57 | ### pwd-bad-option | c | match | |
| 58 | pwd -x; echo "rc=$?" |
| 59 | ### pwd-LP | c | match | |
| 60 | mkdir real; ln -s real lnk |
| 61 | %% |
| 62 | cd lnk; pwd -LP; pwd -PL; echo "rc=$?" |
| 63 | ### pwd-operand | c | match | |
| 64 | pwd a b >/dev/null; echo "rc=$?" |
| 65 | ### export-bad-option | c | match | |
| 66 | export -x; echo "rc=$?" |
| 67 | ### export-eq-name | c | match | |
| 68 | export =a; echo "rc=$?" |
| 69 | ### printf-bad-option | c | match | |
| 70 | printf -x; echo "rc=$?" |
| 71 | ### printf-v | c | refuse=option not supported | |
| 72 | printf -v v %s x |
| 73 | ### unset-bad-name | c | match | |
| 74 | unset 1x; echo "rc=$?" |
| 75 | ### exit-nonnumeric | c | match | |
| 76 | exit x |