Permalink
Browse files

Don't remove trailing spaces from plain lines in spec tests.

xtrace.test.sh now uses the new assertion format.
  • Loading branch information...
Andy Chu
Andy Chu committed Dec 28, 2017
1 parent a086779 commit b24e8df5fb4dbb1538512c05d3d6094641005746
Showing with 24 additions and 1 deletion.
  1. +23 −0 spec/xtrace.test.sh
  2. +1 −1 test/sh_spec.py
View
@@ -23,6 +23,14 @@ echo two >&2
one
+ echo two
two
## OK mksh STDERR:
# mksh traces redirects!
+ >&2
+ echo one
one
+ >&2
+ echo two
two
## END
### PS4 is scoped
@@ -40,4 +48,19 @@ echo two
+ local 'PS4=- '
- echo func
+ echo two
## OK dash STDERR:
# dash loses information about spaces! There is a trailing space, but you
# can't see it.
+ echo one
+ f
+ local PS4=-
- echo func
+ echo two
## OK mksh STDERR:
# local gets turned into typeset
+ echo one
+ f
+ typeset 'PS4=- '
- echo func
+ echo two
## END
View
@@ -141,7 +141,7 @@ def LineIter(f):
# Non-empty line that doesn't start with '#'
# NOTE: We need the original line to test the whitespace sensitive <<-.
# And we need rstrip because we add newlines back below.
yield line_num, PLAIN_LINE, line.rstrip()
yield line_num, PLAIN_LINE, line.rstrip('\n')
yield line_num, EOF, None

0 comments on commit b24e8df

Please sign in to comment.