1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Add more test-cases for positional parameters

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2018-05-25 17:45:25 +02:00
parent b80e0309d2
commit 8687a3f4b8
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -18,7 +18,6 @@ A|'hello\there' | hello\there
A|'hello\\there' | hello\\there A|'hello\\there' | hello\\there
A|"''" | '' A|"''" | ''
A|$. | $. A|$. | $.
A|$1 |
A|he$1x | hex A|he$1x | hex
A|he$.x | he$.x A|he$.x | he$.x
# Next one is different on Windows as $pwd==$PWD # Next one is different on Windows as $pwd==$PWD
@ -137,3 +136,41 @@ A|${:} | error
A|${:-bbb} | error A|${:-bbb} | error
A|${:+bbb} | error A|${:+bbb} | error
# Positional parameters won't be set:
# http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_05_01
A|$1 |
A|${1} |
A|${1:+bbb} |
A|${1:-bbb} | bbb
A|$2 |
A|${2} |
A|${2:+bbb} |
A|${2:-bbb} | bbb
A|$3 |
A|${3} |
A|${3:+bbb} |
A|${3:-bbb} | bbb
A|$4 |
A|${4} |
A|${4:+bbb} |
A|${4:-bbb} | bbb
A|$5 |
A|${5} |
A|${5:+bbb} |
A|${5:-bbb} | bbb
A|$6 |
A|${6} |
A|${6:+bbb} |
A|${6:-bbb} | bbb
A|$7 |
A|${7} |
A|${7:+bbb} |
A|${7:-bbb} | bbb
A|$8 |
A|${8} |
A|${8:+bbb} |
A|${8:-bbb} | bbb
A|$9 |
A|${9} |
A|${9:+bbb} |
A|${9:-bbb} | bbb