diff options
author | jilles <jilles@FreeBSD.org> | 2013-05-31 14:45:25 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2013-05-31 14:45:25 +0000 |
commit | 39d8d22f105aa44916cd71ed8a035e44d10e8fc6 (patch) | |
tree | e35ec4ede45031bdbf31f180b9d828e4096dddfd /tools/regression | |
parent | 8e4a664c2cd6b450743448f7c260c36ece78012b (diff) | |
download | FreeBSD-src-39d8d22f105aa44916cd71ed8a035e44d10e8fc6.zip FreeBSD-src-39d8d22f105aa44916cd71ed8a035e44d10e8fc6.tar.gz |
sh: Add test cases for break outside a loop.
In most shells (including our sh), break outside a loop does nothing with
status 0, or at least does not abort. Therefore, scripts sometimes (buggily)
depend on this.
Diffstat (limited to 'tools/regression')
-rw-r--r-- | tools/regression/bin/sh/builtins/break4.4 | 7 | ||||
-rw-r--r-- | tools/regression/bin/sh/builtins/break5.4 | 12 |
2 files changed, 19 insertions, 0 deletions
diff --git a/tools/regression/bin/sh/builtins/break4.4 b/tools/regression/bin/sh/builtins/break4.4 new file mode 100644 index 0000000..d52ff52 --- /dev/null +++ b/tools/regression/bin/sh/builtins/break4.4 @@ -0,0 +1,7 @@ +# $FreeBSD$ + +# Although this is not specified by POSIX, some configure scripts (gawk 4.1.0) +# appear to depend on it. + +break +exit 4 diff --git a/tools/regression/bin/sh/builtins/break5.4 b/tools/regression/bin/sh/builtins/break5.4 new file mode 100644 index 0000000..7df8e18 --- /dev/null +++ b/tools/regression/bin/sh/builtins/break5.4 @@ -0,0 +1,12 @@ +# $FreeBSD$ + +# Although this is not specified by POSIX, some configure scripts (gawk 4.1.0) +# appear to depend on it. +# In some uncommitted code, the subshell environment corrupted the outer +# shell environment's state. + +(for i in a b c; do + exit 3 +done) +break +exit 4 |