mirror of
https://git.code.sf.net/p/ngspice/ngspice
synced 2026-08-22 13:57:32 +02:00
frontend/parse.c, bug fix, PPlex(.."dc1.@m1[vth][1]"..)
The whole string was lexed into only one TOK_STR instead of the actual (quasi) identifier "dc1.@m1[vth]"
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
|
||||
TESTS = bugs-1.cir dollar-1.cir empty-1.cir resume-1.cir log-functions-1.cir
|
||||
TESTS = bugs-1.cir bugs-2.cir dollar-1.cir empty-1.cir resume-1.cir log-functions-1.cir
|
||||
|
||||
TESTS_ENVIRONMENT = ngspice_vpath=$(srcdir) $(SHELL) $(top_srcdir)/tests/bin/check.sh $(top_builddir)/src/ngspice
|
||||
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
parser test
|
||||
*
|
||||
* test capability to parse @foo[bar][42]
|
||||
* (exec-spice "ngspice %s" t)
|
||||
|
||||
v1 1 0 dc=0
|
||||
|
||||
.control
|
||||
|
||||
save @v1[dc]
|
||||
|
||||
dc v1 0 1 250m
|
||||
|
||||
let foo = @v1[dc]
|
||||
|
||||
let gold = 500m
|
||||
let bar = foo[2]
|
||||
let baz = @v1[dc][2]
|
||||
|
||||
let fail_count = 0
|
||||
|
||||
if bar <> 0.5
|
||||
echo "ERROR: bar = $&bar should be 0.5"
|
||||
let fail_count = fail_count + 1
|
||||
end
|
||||
|
||||
if baz <> 0.5
|
||||
echo "ERROR: baz = $&baz should be 0.5"
|
||||
let fail_count = fail_count + 1
|
||||
end
|
||||
|
||||
if fail_count > 0
|
||||
echo "ERROR: $&fail_count tests failed"
|
||||
quit 1
|
||||
else
|
||||
echo "INFO: $&fail_count tests failed"
|
||||
quit 0
|
||||
end
|
||||
|
||||
.endc
|
||||
|
||||
.end
|
||||
@@ -0,0 +1,8 @@
|
||||
|
||||
Circuit: parser test
|
||||
|
||||
Doing analysis at TEMP = 27.000000 and TNOM = 27.000000
|
||||
|
||||
|
||||
No. of Data Rows : 5
|
||||
INFO: 0 tests failed
|
||||
Reference in New Issue
Block a user