isprime-knuth/test-wycheproof.l
2023-08-25 12:24:37 +03:00

20 lines
448 B
Common Lisp

(load "@lib/json.l")
(load "isprime.l")
(mapc
'((L)
(let
(N (hex (cdr (assoc "value" L)))
R (cdr (assoc "result" L))
I (prime? N) )
(prin ".")
(flush)
(cond
((and (= R "invalid") (not I)))
((and (= R "valid") I))
(T (quit "Boom!")) ) ) )
(cddr (cadadr (assoc "testGroups" (in "primality_test.json" (readJson))))) )
(prinl)
(msg 'ok)
(bye)