~eshel/eshellisp

f2530392609eaab0fd8ce39d2d4bfea66c1e509f — Eshel Yaron 2 years ago 90c605e
Add undefined function exception test case
3 files changed, 6 insertions(+), 3 deletions(-)

M Makefile
M lisp/fib.eshellisp
A lisp/undefined.eshellisp
M Makefile => Makefile +3 -2
@@ 12,8 12,9 @@ lint:
	$(PROLOG) -q -g "use_module(library(diagnostics))" -t halt -- prolog/$(PACKAGE)/*.pl

check: lint $(PACKAGE)
	./$(PACKAGE) lisp/giga.eshellisp 2>&1 | grep -q 1073741824
	./$(PACKAGE) lisp/fib.eshellisp  2>&1 | grep -q 7896325826131730509282738943634332893686268675876375
	./$(PACKAGE) lisp/giga.eshellisp      2>&1 | grep -q 1073741824
	./$(PACKAGE) lisp/fib.eshellisp       2>&1 | grep -q 7896325826131730509282738943634332893686268675876375
	./$(PACKAGE) lisp/undefined.eshellisp 2>&1 | grep -q "lisp/undefined.eshellisp:2:4"

$(PACKAGE): $(SOURCES)
	$(PROLOG) --undefined=error -O -o eshellisp -c prolog/$(PACKAGE)/main.pl

M lisp/fib.eshellisp => lisp/fib.eshellisp +1 -1
@@ 4,4 4,4 @@
(define fib1 (f1 f2 i to)
     (if (<= to i) f2 (fib1 f2 (+ f1 f2) (+ i 1) to)))

(fib 250)
\ No newline at end of file
(fib 250)

A lisp/undefined.eshellisp => lisp/undefined.eshellisp +2 -0
@@ 0,0 1,2 @@
(
    foobar 1 2 3)
\ No newline at end of file