sh: Add test for arithmetic expansion in [x-y] pattern range.

It does not make much sense to generate the '-' in a pattern bracket
expression using arithmetic expansion, but it does not make sense to forbid
it either.

This test already passes.
This commit is contained in:
Jilles Tjoelker 2017-05-13 20:28:32 +00:00
parent 6d284c0153
commit 73a73f7bd2
2 changed files with 11 additions and 0 deletions

View File

@ -40,6 +40,7 @@ ${PACKAGE}FILES+= case17.0
${PACKAGE}FILES+= case18.0
${PACKAGE}FILES+= case19.0
${PACKAGE}FILES+= case20.0
${PACKAGE}FILES+= case21.0
${PACKAGE}FILES+= cd1.0
${PACKAGE}FILES+= cd2.0
${PACKAGE}FILES+= cd3.0

View File

@ -0,0 +1,10 @@
# $FreeBSD$
case 5 in
[0$((-9))]) ;;
*) echo bad1 ;;
esac
case - in
[0$((-9))]) echo bad2 ;;
esac