blob: 23525d28d25f542e75ed54987f3f9360dca25c4b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
#!/bin/sh
source $(dirname "$0")/test-commons.inc
if not test "$*" = "" { fail "Argv list not empty" }
if not test "$#" -eq 0 { fail "Argv list empty but count non-zero" }
if not test "$ARGV" = "$*" { fail "\$ARGV not equal to \$*" }
ARGV=(1 2 3)
if not test "$#" -eq 3 { fail "Assignment to ARGV does not affect \$#" }
if not test "$*" = "1 2 3" { fail "Assignment to ARGV does not affect \$*" }
shift
if not test "$*" = "2 3" { fail "'shift' does not work correctly" }
shift 2
if not test "$*" = "" { fail "'shift 2' does not work correctly" }
echo PASS
|