fish-shell/tests/test1.err
Fabian Homborg 3847d2e9d1 Also set the read-only flag for non-electric vars
For some reason, we have two places where a variable can be read-only:

- By key in env.cpp:is_read_only(), which is checked via set*

- By flag on the actual env_var_t, which is checked e.g. in
  parse_execution

The latter didn't happen for non-electric variables like hostname,
because they used the default constructor, because they were
constructed via operator[] (or some such C++-iness).

This caused for-loops to crash on an assert if they used a
non-electric read-only var like $hostname or $SHLVL.

Instead, we explicitly set the flag.

We might want to remove one of the two read-only checks, or something?

Fixes #5548.
2019-01-18 19:27:41 +01:00

57 lines
1.3 KiB
Text

####################
# Comments in odd places don't cause problems
####################
# Bracket expansion
####################
# Escaped newlines
####################
# Simple function tests
####################
# Ensure eval doesn't unnecessarily mess with the exit status
####################
# Verify that we can turn stderr into stdout and then pipe it
####################
# Test that trailing ^ doesn't trigger redirection, see #1873
####################
# Verify that we can pipe something other than stdout
####################
# echo tests
####################
# Verify that pipes don't conflict with fd redirections
####################
# Make sure while loops don't run forever with no-exec (#1543)
####################
# For loops with read-only vars is an error (#4342)
fish: You cannot use read-only variable 'status' in a for loop
for status in a b c
^
####################
# That goes for non-electric ones as well (#5548)
fish: You cannot use read-only variable 'hostname' in a for loop
for hostname in a b c
^
####################
# For loop control vars available outside the for block
####################
# Comments allowed in between lines (#1987)
####################
# Backslashes are part of comments and do not join lines (#1255)
####################
# Verify $argv set correctly in sourced scripts (#139)