added more test code
This commit is contained in:
parent
ff089929a9
commit
0725bfe27a
@ -12,6 +12,7 @@ A HCL program is composed of expressions.
|
|||||||
## Special Form Expression
|
## Special Form Expression
|
||||||
* and
|
* and
|
||||||
* break
|
* break
|
||||||
|
* defclass
|
||||||
* defun
|
* defun
|
||||||
* do
|
* do
|
||||||
* elif
|
* elif
|
||||||
|
@ -4,7 +4,7 @@ check_SCRIPTS = \
|
|||||||
insta-01.hcl \
|
insta-01.hcl \
|
||||||
insta-02.hcl \
|
insta-02.hcl \
|
||||||
ret-01.hcl \
|
ret-01.hcl \
|
||||||
retvar-01.hcl
|
retvar-01.hcl \
|
||||||
var-01.hcl
|
var-01.hcl
|
||||||
|
|
||||||
##noinst_SCRIPTS = $(check_SCRIPTS)
|
##noinst_SCRIPTS = $(check_SCRIPTS)
|
||||||
|
@ -465,7 +465,8 @@ check_SCRIPTS = \
|
|||||||
insta-01.hcl \
|
insta-01.hcl \
|
||||||
insta-02.hcl \
|
insta-02.hcl \
|
||||||
ret-01.hcl \
|
ret-01.hcl \
|
||||||
retvar-01.hcl
|
retvar-01.hcl \
|
||||||
|
var-01.hcl
|
||||||
|
|
||||||
EXTRA_DIST = $(check_SCRIPTS)
|
EXTRA_DIST = $(check_SCRIPTS)
|
||||||
TEST_EXTENSIONS = .hcl
|
TEST_EXTENSIONS = .hcl
|
||||||
@ -838,7 +839,6 @@ uninstall-am:
|
|||||||
|
|
||||||
.PRECIOUS: Makefile
|
.PRECIOUS: Makefile
|
||||||
|
|
||||||
var-01.hcl
|
|
||||||
|
|
||||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||||
|
27
t/var-01.hcl
27
t/var-01.hcl
@ -63,3 +63,30 @@
|
|||||||
)
|
)
|
||||||
|
|
||||||
(x)
|
(x)
|
||||||
|
|
||||||
|
|
||||||
|
(defclass T
|
||||||
|
| j |
|
||||||
|
|
||||||
|
(defun ::* new()
|
||||||
|
(set j 99)
|
||||||
|
(return self)
|
||||||
|
)
|
||||||
|
|
||||||
|
(defun x()
|
||||||
|
(do
|
||||||
|
| x |
|
||||||
|
(set x 1)
|
||||||
|
(while (< x j)
|
||||||
|
(defun Q() x)
|
||||||
|
(set x (+ x 1))
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
(set t (:T new))
|
||||||
|
(:t x)
|
||||||
|
(set t (Q))
|
||||||
|
(if (/= t 99) (print "ERROR: t is not 99\n")
|
||||||
|
else (printf "OK: %d\n" t))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user