last tweak, to demonstrate brokenness of the old code

This commit is contained in:
tg
2017-04-06 02:15:22 +00:00
parent 3909a42540
commit 6f991beb90

View File

@@ -1,4 +1,4 @@
# $MirOS: src/bin/mksh/check.t,v 1.771 2017/04/06 01:59:51 tg Exp $ # $MirOS: src/bin/mksh/check.t,v 1.772 2017/04/06 02:15:22 tg Exp $
# -*- mode: sh -*- # -*- mode: sh -*-
#- #-
# Copyright © 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # Copyright © 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
@@ -10941,6 +10941,7 @@ stdin:
--- ---
name: comsub-5 name: comsub-5
description: description:
Check COMSUB works with aliases (does not expand them twice)
and reentrancy safety and reentrancy safety
stdin: stdin:
print '#!'"$__progname"'\nfor x in "$@"; do print -r -- "$x"; done' >pfn print '#!'"$__progname"'\nfor x in "$@"; do print -r -- "$x"; done' >pfn
@@ -10953,12 +10954,16 @@ stdin:
./pfn "$(echo b)" ./pfn "$(echo b)"
typeset -f foo >x typeset -f foo >x
cat x cat x
foo
. ./x . ./x
typeset -f foo typeset -f foo
foo
expected-stdout: expected-stdout:
a b a b
foo() {
\echo a moo \echo a moo
./pfn "$(\echo a foo )" ./pfn "$(\echo a foo )"
}
a moo a moo
a foo a foo
foo() { foo() {