regression test for: return works in funsub (like AT&T ksh93), local works in funsub (like in functions), exit does not work in funsub (sadly unlike ksh93, like in functions)

This commit is contained in:
tg 2013-02-10 23:36:21 +00:00
parent c95d0ad11e
commit 19cbb1ab78

15
check.t
View File

@ -1,4 +1,4 @@
# $MirOS: src/bin/mksh/check.t,v 1.590 2013/02/10 23:32:18 tg Exp $
# $MirOS: src/bin/mksh/check.t,v 1.591 2013/02/10 23:36:21 tg Exp $
# $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $
# $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $
# $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $
@ -9787,6 +9787,19 @@ expected-stdout:
ia baz : .
oa baz .
---
name: funsub-2
description:
You can now reliably use local and return in funsubs
(not exit though)
stdin:
x=q; e=1; x=${ echo a; e=2; echo x$e;}; echo 1:y$x,$e,$?.
x=q; e=1; x=${ echo a; typeset e=2; echo x$e;}; echo 2:y$x,$e,$?.
x=q; e=1; x=${ echo a; typeset e=2; return 3; echo x$e;}; echo 3:y$x,$e,$?.
expected-stdout:
1:ya x2,2,0.
2:ya x2,1,0.
3:ya,1,3.
---
name: test-stnze-1
description:
Check that the short form [ $x ] works