about summary refs log tree commit diff
path: root/Test/A01grammar.ztst
diff options
context:
space:
mode:
authorPeter Stephenson <p.w.stephenson@ntlworld.com>2021-09-09 20:05:39 +0100
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2021-09-09 20:05:39 +0100
commitdb46c9cd5844240fb6015666c8e2a12a0a3a6ead (patch)
tree096490f0615dea304e29a2d8b03115b0ecc6b4f3 /Test/A01grammar.ztst
parent014fbfa46b3550a74f1e414d56d1faddd2d9dff5 (diff)
downloadzsh-db46c9cd5844240fb6015666c8e2a12a0a3a6ead.tar.gz
zsh-db46c9cd5844240fb6015666c8e2a12a0a3a6ead.tar.xz
zsh-db46c9cd5844240fb6015666c8e2a12a0a3a6ead.zip
49353: Fix comments in sourced file.
If the file was sourced from an interactive shell with
INTERACTIVE_COMMENTS not set, comments were not parsed.

Note there is a remaining edge case where the sourced
file is in fact entered at the comment line.
Diffstat (limited to 'Test/A01grammar.ztst')
-rw-r--r--Test/A01grammar.ztst9
1 files changed, 9 insertions, 0 deletions
diff --git a/Test/A01grammar.ztst b/Test/A01grammar.ztst
index 88fc8606e..c114ff103 100644
--- a/Test/A01grammar.ztst
+++ b/Test/A01grammar.ztst
@@ -944,3 +944,12 @@ F:Note that the behaviour of 'exit' inside try-list inside a function is unspeci
  if : ${(e)a}; then echo x; fi
 1:Status on bad substitution in if without else
 ?(eval):2: bad substitution
+
+ echo 'echo foo # comment
+  echo $(
+  echo bar # comment
+ )' >source_comments.zsh
+ $ZTST_testdir/../Src/zsh -f -o extendedglob -is -c '. ./source_comments.zsh'
+0:Comments should be handled in command subst in interactively sourced files
+>foo
+>bar