opnsense-src/tools/regression/bin/sh/parser/case2.0
Jilles Tjoelker 084d796d16 sh: Add some parser tests.
case1.0 tests POSIX requirements and one more for keywords in case
statements. The others test very special cases of command substitution.

These also work on stable/8.
2010-05-09 17:10:50 +00:00

32 lines
342 B
Text

# $FreeBSD$
# Pretty much only ash derivatives can parse all of this.
f1() {
x=$(case x in
(x|esac) ;;
(*) echo bad >&2 ;;
esac)
}
f1
f2() {
x=$(case x in
(x|esac) ;;
(*) echo bad >&2
esac)
}
f2
f3() {
x=$(case x in
x|esac) ;;
*) echo bad >&2 ;;
esac)
}
f3
f4() {
x=$(case x in
x|esac) ;;
*) echo bad >&2
esac)
}
f4