From 9ddfea1cbd2df6fb0d87f9d145971f142876c7e4 Mon Sep 17 00:00:00 2001 From: Ryuichi Ueda Date: Thu, 27 Feb 2025 18:51:17 +0900 Subject: [PATCH] Relocate test cases --- test/test_fixed.bash | 21 --------------------- test/test_others.bash | 11 +++++++++++ test/test_parameters.bash | 11 +++++++++++ 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/test/test_fixed.bash b/test/test_fixed.bash index 6f907ec3..269d2c2c 100755 --- a/test/test_fixed.bash +++ b/test/test_fixed.bash @@ -17,27 +17,6 @@ err () { cd $(dirname $0) com=../target/release/sush -res=$($com <<< 'a=A ; echo ${a:-B}' ) -[ "$res" = "A" ] || err $LINENO - -res=$($com <<< 'rev <(echo abc)' ) -[ "$res" = "cba" ] || err $LINENO - -res=$($com <<< 'rev < <(echo abc)' ) -[ "$res" = "cba" ] || err $LINENO - -res=$($com <<< '__a=x; echo $__a ; echo $__a' ) -[ "$res" = "x -x" ] || err $LINENO - -res=$($com <<< ' -_=aaa -echo $_ -echo $_ -' ) -[ "$res" = " -echo" ] || err $LINENO - echo $0 >> ./ok exit diff --git a/test/test_others.bash b/test/test_others.bash index 0776d259..aeb16e3f 100755 --- a/test/test_others.bash +++ b/test/test_others.bash @@ -147,6 +147,9 @@ EOF [ "$res" = "-- a" ] || err $LINENO +res=$($com <<< 'a=A ; echo ${a:-B}' ) +[ "$res" = "A" ] || err $LINENO + # offset res=$($com <<< 'A=abc; echo ${A:1}' ) @@ -709,6 +712,14 @@ res=$($com <<< 'A=( a b ); A[0]=( 1 2 )') res=$($com <<< 'A=( a b ); A[]=1') [ "$?" == 1 ] || err $LINENO +### PROCESS SUBSTITUTION ### + +res=$($com <<< 'rev <(echo abc)' ) +[ "$res" = "cba" ] || err $LINENO + +res=$($com <<< 'rev < <(echo abc)' ) +[ "$res" = "cba" ] || err $LINENO + # symbol res=$($com <<< 'echo ]') diff --git a/test/test_parameters.bash b/test/test_parameters.bash index 66e1ce28..f820657c 100755 --- a/test/test_parameters.bash +++ b/test/test_parameters.bash @@ -175,5 +175,16 @@ EOF [ "$res" = "3 1" ] || err $LINENO +res=$($com <<< ' +_=aaa +echo $_ +echo $_ +' ) +[ "$res" = " +echo" ] || err $LINENO + +res=$($com <<< '__a=x; echo $__a ; echo $__a' ) +[ "$res" = "x +x" ] || err $LINENO echo $0 >> ./ok