diff options
author | Kurtis Rader <krader@skepticism.us> | 2016-04-09 18:56:13 -0700 |
---|---|---|
committer | Kurtis Rader <krader@skepticism.us> | 2016-04-10 18:40:11 -0700 |
commit | 59f0261dba993a5d632ce6e9963270a582d162e6 (patch) | |
tree | ebc0be44c6259fc090c2612703f7e66366cc0ef3 /tests | |
parent | 7ad6a90ea2e75388d42b5b223d9273119994037e (diff) |
enhance fish_indent to normalize keywords
Fish keywords can be quoted and split across lines. Prior to this change
`fish_indent` would retain such odd, obfuscated, formatting. This change
results in all keywords being converted to their canonical form.
This required fixing a bug: the keyword member of parse_node_t wasn't being
populated. This hadn't been noticed prior to now because it wasn't used.
Fixes #2921
Diffstat (limited to 'tests')
-rw-r--r-- | tests/indent.in | 15 | ||||
-rw-r--r-- | tests/indent.out | 10 |
2 files changed, 25 insertions, 0 deletions
diff --git a/tests/indent.in b/tests/indent.in index a1143c67..2d98dd8e 100644 --- a/tests/indent.in +++ b/tests/indent.in @@ -89,3 +89,18 @@ echo \nTest redir formatting echo -n ' echo < stdin >>appended yes 2>&1 no > stdout maybe 2>& 4 | cat 2>| cat ' | ../test/root/bin/fish_indent + +echo \nTest normalization of keywords +# issue 2921 +echo -n ' +i\ +f true + echo yes +en\ +d + +"whil\ +e" true + "builtin" yes +en"d" +' | ../test/root/bin/fish_indent diff --git a/tests/indent.out b/tests/indent.out index 6b38a72f..5a4d9dc0 100644 --- a/tests/indent.out +++ b/tests/indent.out @@ -95,3 +95,13 @@ end Test redir formatting echo <stdin >>appended yes 2>&1 no >stdout maybe 2>&4 | cat 2>| cat + +Test normalization of keywords + +if true + echo yes +end + +while true + builtin yes +end |