From d6a4694d9f94562f6e34d91c7088774a8ace5da2 Mon Sep 17 00:00:00 2001 From: David Adam Date: Tue, 9 Apr 2019 20:10:51 +0800 Subject: [PATCH] tests: add test for invalid variable name in for loop Work on #5800. --- tests/test3.err | 7 +++++++ tests/test3.in | 4 ++++ tests/test3.out | 3 +++ 3 files changed, 14 insertions(+) diff --git a/tests/test3.err b/tests/test3.err index 30aa0088a..1d1eafdb3 100644 --- a/tests/test3.err +++ b/tests/test3.err @@ -1,3 +1,10 @@ #################### # Path universal variables + +#################### +# Variable names in other commands +fish: for: Variable name 'a,b' is not valid. See `help identifiers`. + +for a,b in y 1 z 3; echo $a,$b; end + ^ diff --git a/tests/test3.in b/tests/test3.in index 12cfa41b0..53f637f76 100644 --- a/tests/test3.in +++ b/tests/test3.in @@ -326,4 +326,8 @@ echo "$__fish_test_PATH" $__fish_test_PATH set -U --path __fish_test_path2 a:b echo "$__fish_test_path2" $__fish_test_path2 +logmsg Variable names in other commands +# Test invalid variable names in loops (#5800) +for a,b in y 1 z 3; echo $a,$b; end + true diff --git a/tests/test3.out b/tests/test3.out index ef5cf91cd..07c15bef4 100644 --- a/tests/test3.out +++ b/tests/test3.out @@ -55,3 +55,6 @@ a:b:c 1 2 3 a b c 1 2 3 a:b:c 1:2:3 a b c 1 2 3 1:2:3 1 2 3 a:b a b + +#################### +# Variable names in other commands