From 40b33b6b04d81d2c6ca52175a83c31fa1bc91621 Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Mon, 9 Mar 2020 04:00:31 -0400 Subject: Import /usr/src/bin/sh from FreeBSD 12.1-RELEASE --- bin/1sh/tests/expansion/cmdsubst10.0 | 51 ++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 bin/1sh/tests/expansion/cmdsubst10.0 (limited to 'bin/1sh/tests/expansion/cmdsubst10.0') diff --git a/bin/1sh/tests/expansion/cmdsubst10.0 b/bin/1sh/tests/expansion/cmdsubst10.0 new file mode 100644 index 00000000..fe357a7d --- /dev/null +++ b/bin/1sh/tests/expansion/cmdsubst10.0 @@ -0,0 +1,51 @@ +# $FreeBSD: releng/12.1/bin/sh/tests/expansion/cmdsubst10.0 216826 2010-12-30 22:33:55Z jilles $ + +a1=$(alias) +: $(alias testalias=abcd) +a2=$(alias) +[ "$a1" = "$a2" ] || echo Error at line $LINENO + +alias testalias2=abcd +a1=$(alias) +: $(unalias testalias2) +a2=$(alias) +[ "$a1" = "$a2" ] || echo Error at line $LINENO + +[ "$(command -V pwd)" = "$(command -V pwd; exit $?)" ] || echo Error at line $LINENO + +v=1 +: $(export v=2) +[ "$v" = 1 ] || echo Error at line $LINENO + +rotest=1 +: $(readonly rotest=2) +[ "$rotest" = 1 ] || echo Error at line $LINENO + +set +u +: $(set -u) +case $- in +*u*) echo Error at line $LINENO ;; +esac +set +u + +set +u +: $(set -o nounset) +case $- in +*u*) echo Error at line $LINENO ;; +esac +set +u + +set +u +: $(command set -u) +case $- in +*u*) echo Error at line $LINENO ;; +esac +set +u + +umask 77 +u1=$(umask) +: $(umask 022) +u2=$(umask) +[ "$u1" = "$u2" ] || echo Error at line $LINENO + +dummy=$(exit 3); [ $? -eq 3 ] || echo Error at line $LINENO -- cgit 1.4.1