aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/expansion.in
Commit message (Collapse)AuthorAge
* Pass the character index, not the character, to parse_util_expand_variable_errorGravatar ridiculousfish2015-05-15
| | | | Fixes #2067
* Define a common `mktemp` for testsGravatar Kevin Ballard2014-11-24
| | | | | | | | | | GNU and BSD `mktemp` handle options differently, and it's a useful utility for tests. As such, define a common `mktemp` function wrapper for the test suite. It might actually be nice to expand this for more flags and support it globally, but that may result in confusion for any users of BSD mktemp that expect to be running /bin/mktemp.
* Fix expansion tests on OS XGravatar ridiculousfish2014-10-30
|
* expand: expand tilde to canonical pathsGravatar David Adam2014-10-26
| | | | Work on #1133.
* Fix error span for invalid slice indexesGravatar Kevin Ballard2014-08-21
| | | | | | | | The span now properly points at the token that was invalid, rather than the start of the slice. Also fix the span for `()[1]` and `()[d]`, which were previously reporting no source location at all.
* Parse slices even for empty variablesGravatar Kevin Ballard2014-08-20
| | | | | | | | | | | | | When a variable is parsed as being empty, parse out the slice and validate the indexes anyway, behaving for slicing purposes as if the variable had a single empty value. Besides providing errors when expected, this also fixes the following: set -l foo echo "$foo[1]" This used to print "[1]", now it properly prints nothing.
* Fix double expansions (`$$foo`)Gravatar Kevin Ballard2014-08-20
Double expansions of variables had the following issues: * `"$$foo"` threw an error no matter what the value of `$foo` was. * `set -l foo ''; echo $$foo` threw an error because of the expansion of `$foo` to `''`. With this change, double expansion always works properly. When double-expanding a multi-valued variable, in a double-quoted string the first word of the inner expansion is used for the outer expansion, and outside of a quoted string every word is used for the double-expansion in each of the arguments. > set -l foo bar baz > set -l bar one two > set -l baz three four > echo "$$foo" one two baz > echo $$foo one two three four