Skip to content

Commit

Permalink
Relocate test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuichiueda committed Feb 27, 2025
1 parent b78aecd commit 9ddfea1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 21 deletions.
21 changes: 0 additions & 21 deletions test/test_fixed.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
11 changes: 11 additions & 0 deletions test/test_others.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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}' )
Expand Down Expand Up @@ -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 ]')
Expand Down
11 changes: 11 additions & 0 deletions test/test_parameters.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 9ddfea1

Please sign in to comment.