Corrected _proxy-to to accept variable shift length

env
Mike Gerwitz 2014-05-13 21:38:30 -04:00
parent eb188fe477
commit dc5a5d8f0f
No known key found for this signature in database
GPG Key ID: F22BB8158EE30EAB
2 changed files with 21 additions and 1 deletions

View File

@ -200,7 +200,7 @@ _handle-to()
# latter assumes that its arguments are *only* the intended remainder clause # latter assumes that its arguments are *only* the intended remainder clause
_proxy-to() _proxy-to()
{ {
shift $__SHIFTN shift "$2"
_handle-to "$@" _handle-to "$@"
} }

View File

@ -335,5 +335,25 @@ describe expect
'; to succeed '; to succeed
end end
end end
describe _proxy-to
it proxies remainder clause with variable shift length
expect test-run <<< '
expected="foo bar baz"
_expect--chk() { shift "$2"; test "$*" == "$expected"; }
describe foo
it should succeed
expect _proxy-to 0 2 chk $expected
to succeed
expect _proxy-to 0 3 /dev/null chk $expected
to succeed
end
end
'; to succeed
end
end
end end