Op 15-04-18 om 04:09 schreef Martijn Dekker:
Op 15-04-18 om 03:41 schreef Philip Guenther:
On Sun, 15 Apr 2018, Klemens Nanni wrote:
It also badly effects non-empty cases:
...
$ ./obj/ksh -c alias
autoload=''
functions=''
Hah! The original diff i actually broken (it tests the wrong variable)
but I fixed that by accident when I manually made the diff in my tree!
So, uh, I'm no longer fine with the original diff...
D'oh!
That's embarrassing. Sorry about that. :-/
Here are a couple of regression tests.
- M.
Index: regress/bin/ksh/syntax.t
===================================================================
RCS file: /cvs/src/regress/bin/ksh/syntax.t,v
retrieving revision 1.1
diff -u -p -r1.1 syntax.t
--- regress/bin/ksh/syntax.t 2 Dec 2013 20:39:44 -0000 1.1
+++ regress/bin/ksh/syntax.t 15 Apr 2018 02:44:48 -0000
@@ -8,3 +8,36 @@ expected-stderr-pattern:
/syntax error/
---
+name: syntax-quoted-output-1
+description:
+ Check that 'trap' outputs properly quoted trap actions
+stdin:
+ trap "" INFO
+ trap foo USR1
+ trap foo\ bar USR2
+ trap
+expected-exit: e == 0
+expected-stdout:
+ trap -- '' INFO
+ trap -- foo USR1
+ trap -- 'foo bar' USR2
+---
+
+name: syntax-quoted-output-2
+description:
+ Check that 'alias' outputs properly quoted aliases
+stdin:
+ unalias -a
+ alias empty=
+ alias oneword=foo
+ alias twowords=foo\ bar
+ alias extrablanks=" foo bar "
+ alias
+expected-exit: e == 0
+expected-stdout:
+ empty=''
+ extrablanks=' foo bar '
+ oneword=foo
+ twowords='foo bar'
+---
+