Corrected _proxy-to to accept variable shift length
parent
eb188fe477
commit
dc5a5d8f0f
2
src/spec
2
src/spec
|
@ -200,7 +200,7 @@ _handle-to()
|
|||
# latter assumes that its arguments are *only* the intended remainder clause
|
||||
_proxy-to()
|
||||
{
|
||||
shift $__SHIFTN
|
||||
shift "$2"
|
||||
_handle-to "$@"
|
||||
}
|
||||
|
||||
|
|
|
@ -335,5 +335,25 @@ describe expect
|
|||
'; to succeed
|
||||
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
|
||||
|
||||
|
|
Loading…
Reference in New Issue