summaryrefslogtreecommitdiff
path: root/test.lisp
diff options
context:
space:
mode:
authorJuan Manuel Tomás <jtomas1815@gmail.com>2026-08-28 06:16:12 -0300
committerJuan Manuel Tomás <jtomas1815@gmail.com>2026-08-28 06:16:12 -0300
commit401fd8f16664d81d84c2fd7ecbc2333d6f3ec108 (patch)
tree72f168f760a8bb521a73535b46feafd29b33c2c0 /test.lisp
parent0150531bb547fc5f2a193eb3fa51e654e67c73e5 (diff)
downloadmonparser-401fd8f16664d81d84c2fd7ecbc2333d6f3ec108.tar.gz
monparser-401fd8f16664d81d84c2fd7ecbc2333d6f3ec108.zip
Prepare for new tracing and tidy up testing
Main stuff was moved into base so that I can better incorporate tracing in the future. I'm thinking it will involve modifying new and bind.
Diffstat (limited to 'test.lisp')
-rw-r--r--test.lisp9
1 files changed, 5 insertions, 4 deletions
diff --git a/test.lisp b/test.lisp
index 358ceb4..1d98702 100644
--- a/test.lisp
+++ b/test.lisp
@@ -8,7 +8,7 @@
(format nil "~a" result)
(format nil "~a" (parsing-tree result))))
-(defun check-result (actual expected input)
+(defun check-result (actual expected)
(cond ((eq expected :failure)
(or (failure-p actual)
(progn
@@ -19,7 +19,7 @@
(or (funcall expected actual)
(progn
(format t "~tFAIL: custom check failed~&")
- (format t "~t~tInput: ~a~&" input)
+ (format t "~t~tInput: ~a~&" (result-place actual))
(format t "~t~tResult: ~a~&" actual)
(incf *test-failed*)
nil)))
@@ -61,9 +61,10 @@
(input (second test))
(expected (third test)))
(push `(let ((actual (parse ,parser ,input)))
- (if (check-result actual ,expected ,input)
+ (if (check-result actual ,expected)
(incf *test-passed*)
- (incf *test-failed*))) test-forms)))
+ (incf *test-failed*)))
+ test-forms)))
(setf test-forms (nreverse test-forms))
`(progn
(let ((had-failures *test-failed*))