Permalink
Browse files

Remove unnecessary assertion which caused a crash with nested here docs.

Uncovered by wild tests.
  • Loading branch information...
Andy Chu
Andy Chu committed Sep 8, 2018
1 parent 0ba26bf commit 1aae97c62d347d38d634845dc6ae6fa360c9e7b2
Showing with 15 additions and 2 deletions.
  1. +0 −1 osh/cmd_parse.py
  2. +14 −0 spec/here-doc.test.sh
  3. +1 −1 test/spec.sh
View
@@ -40,7 +40,6 @@ def _ReadHereLines(line_reader, h, delimiter):
last_line = None
while True:
line_id, line, unused_offset = line_reader.GetLine()
assert unused_offset == 0
if not line: # EOF
# An unterminated here doc is just a warning in bash. We make it
View
@@ -324,6 +324,19 @@ here doc in IF CONDITION
THEN executed
## END
#### Nested here docs which are indented
cat <<- EOF
outside
$(cat <<- INSIDE
inside
INSIDE
)
EOF
## STDOUT:
outside
inside
## END
#### Multiple here docs in pipeline
# SKIPPED: hangs with osh on Debian
# The second instance reads its stdin from the pipe, and fd 5 from a here doc.
@@ -350,3 +363,4 @@ EOF5
0: 3: fd3
5: fd5
## END
View
@@ -400,7 +400,7 @@ here-doc() {
# - On Debian, the whole process hangs.
# Is this due to Python 3.2 vs 3.4? Either way osh doesn't implement the
# functionality, so it's probably best to just implement it.
sh-spec spec/here-doc.test.sh --range 0-30 \
sh-spec spec/here-doc.test.sh --range 0-31 \
${REF_SHELLS[@]} $OSH_LIST "$@"
}

0 comments on commit 1aae97c

Please sign in to comment.