use new logmsg and set --show in tests

This commit is contained in:
Kurtis Rader 2017-08-03 20:56:14 -07:00
parent ec884f4bfd
commit ecf06f2eb4
3 changed files with 29 additions and 20 deletions

View file

@ -1,9 +1,10 @@
# Command sub at the limit should fail. # Command sub just under the limit should succeed
# Command sub at the limit should fail
fish: Too much data emitted by command substitution so it was discarded fish: Too much data emitted by command substitution so it was discarded
set b (string repeat -n 512 x) set b (string repeat -n 512 x)
^ ^
# Command sub over the limit should fail. # Command sub over the limit should fail
fish: Too much data emitted by command substitution so it was discarded fish: Too much data emitted by command substitution so it was discarded
set -l x (string repeat -n $argv x) set -l x (string repeat -n $argv x)
@ -15,6 +16,7 @@ in function 'subme'
in command substitution in command substitution
called on standard input called on standard input
# Make sure output from builtins outside of command substitution is not affected
# Same builtin in a command substitution is affected # Same builtin in a command substitution is affected
fish: Too much data emitted by command substitution so it was discarded fish: Too much data emitted by command substitution so it was discarded

View file

@ -8,27 +8,25 @@ function subme
echo $x echo $x
end end
echo '# Command sub just under the limit should succeed.' logmsg Command sub just under the limit should succeed
set a (subme 511) set a (subme 511)
show a set --show a
echo '# Command sub at the limit should fail.' logmsg Command sub at the limit should fail
echo '# Command sub at the limit should fail.' >&2
set b (string repeat -n 512 x) set b (string repeat -n 512 x)
set saved_status $status set saved_status $status
test $saved_status -eq 122 test $saved_status -eq 122
or echo expected status 122, saw $saved_status >&2 or echo expected status 122, saw $saved_status >&2
show b set --show b
echo '# Command sub over the limit should fail.' logmsg Command sub over the limit should fail
echo '# Command sub over the limit should fail.' >&2
set c (subme 513) set c (subme 513)
show c set --show c
echo '# Make sure output from builtins outside of command substitution is not affected' logmsg Make sure output from builtins outside of command substitution is not affected
string repeat --max 513 a string repeat --max 513 a
echo '# Same builtin in a command substitution is affected' >&2 logmsg Same builtin in a command substitution is affected
echo this will fail (string repeat --max 513 b) to output anything echo this will fail (string repeat --max 513 b) to output anything
set saved_status $status set saved_status $status
test $saved_status -eq 122 test $saved_status -eq 122

View file

@ -1,10 +1,19 @@
# Command sub just under the limit should succeed. # Command sub just under the limit should succeed
$a count=1 $a: not set in local scope
$a[1]=|xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx| $a: set in global scope, unexported, with 1 elements
# Command sub at the limit should fail. $a[0]: length=511 value=|xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|
$b is not set $a: not set in universal scope
# Command sub over the limit should fail.
$c count=1 # Command sub at the limit should fail
$c[1]=|| $b: not set in local scope
$b: not set in global scope
$b: not set in universal scope
# Command sub over the limit should fail
$c: not set in local scope
$c: set in global scope, unexported, with 0 elements
$c: not set in universal scope
# Make sure output from builtins outside of command substitution is not affected # Make sure output from builtins outside of command substitution is not affected
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
# Same builtin in a command substitution is affected