Browse Source
src/frontend/variable.c, fix expansion of '$var' when $var is an empty list
src/frontend/variable.c, fix expansion of '$var' when $var is an empty list
test case: set foo = ( ) set foo = ( $foo baz bar ) echo $foopre-master-46
4 changed files with 87 additions and 8 deletions
-
26src/frontend/variable.c
-
2tests/regression/misc/Makefile.am
-
43tests/regression/misc/dollar-1.cir
-
24tests/regression/misc/dollar-1.out
@ -0,0 +1,43 @@ |
|||||
|
test $var expansion |
||||
|
|
||||
|
v1 1 0 dc = 0 |
||||
|
|
||||
|
.control |
||||
|
|
||||
|
set foo = "" |
||||
|
echo "TEST:" ">{$foo}< should be ><" |
||||
|
|
||||
|
set foo = ( 1 2 3 ) |
||||
|
set bar = 2 |
||||
|
echo "TEST:" ">$foo[0]< should be >1<" |
||||
|
echo "TEST:" ">$foo[$bar]< should be >2<" |
||||
|
|
||||
|
set foo = ( $foo baz bar ) |
||||
|
echo "TEST:" $foo |
||||
|
echo "TEST:" "should be >1 2 3 baz bar<" |
||||
|
echo "TEST:" ">$foo[0]< should be >1<" |
||||
|
|
||||
|
set aux = ( ) |
||||
|
echo "TEST:" $aux "end" |
||||
|
|
||||
|
set foo = ( $aux mi au ) |
||||
|
set bar = ( mi $aux au ) |
||||
|
set baz = ( mi au $aux ) |
||||
|
|
||||
|
echo "TEST:" $foo |
||||
|
echo "TEST:" "should be >mi au<" |
||||
|
echo "TEST:" ">$foo[0]< should be >mi<" |
||||
|
|
||||
|
echo "TEST:" $bar |
||||
|
echo "TEST:" "should be >mi au<" |
||||
|
echo "TEST:" ">$bar[0]< should be >mi<" |
||||
|
|
||||
|
echo "TEST:" $baz |
||||
|
echo "TEST:" "should be >mi au<" |
||||
|
echo "TEST:" ">$baz[0]< should be >mi<" |
||||
|
|
||||
|
quit 0 |
||||
|
|
||||
|
.endc |
||||
|
|
||||
|
.end |
||||
@ -0,0 +1,24 @@ |
|||||
|
|
||||
|
Circuit: test for regression of already fixed bugs |
||||
|
|
||||
|
TEST: >< should be >< |
||||
|
TEST: >1< should be >1< |
||||
|
TEST: >2< should be >2< |
||||
|
TEST: 1 2 3 baz bar |
||||
|
TEST: should be >1 2 3 baz bar< |
||||
|
TEST: >1< should be >1< |
||||
|
TEST: end |
||||
|
TEST: mi au |
||||
|
TEST: should be >mi au< |
||||
|
TEST: >mi< should be >mi< |
||||
|
TEST: mi au |
||||
|
TEST: should be >mi au< |
||||
|
TEST: >mi< should be >mi< |
||||
|
TEST: mi au |
||||
|
TEST: should be >mi au< |
||||
|
TEST: >mi< should be >mi< |
||||
|
|
||||
|
Doing analysis at TEMP = 27.000000 and TNOM = 27.000000 |
||||
|
|
||||
|
|
||||
|
No. of Data Rows : 1 |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue