tests/checks/read: add test for non-interactive use of commandline

This commit is contained in:
Johannes Altmanninger
2025-10-06 10:55:22 +02:00
parent b7fabb11ac
commit ec8756d7a3
2 changed files with 8 additions and 1 deletions

View File

@@ -65,3 +65,10 @@ $fish -ic '
# CHECK: hello
# CHECK: helloworld
# CHECK: hello world
$fish -c 'commandline foo'
# CHECKERR: commandline: Can not set commandline in non-interactive mode
# CHECKERR: Standard input (line 1):
# CHECKERR: commandline foo
# CHECKERR: ^
# CHECKERR: (Type 'help commandline' for related documentation)

View File

@@ -245,7 +245,7 @@ if test (string length "$x") -ne $fish_read_limit
echo reading with a limited amount of input data failed the length test
end
# Confirm reading non-interactively works -- \#4206 regression
# Confirm reading non-interactively works -- #4206 regression
echo abc\ndef | $fish -i -c 'read a; read b; set --show a; set --show b'
#CHECK: $a: set in global scope, unexported, with 1 elements
#CHECK: $a[1]: |abc|