Move the Chez test oracle off Janet
The unit tests in test/chez/_*.janet now drive bin/joltc (the zero-Janet spine) and judge against baked expected values instead of a live build/jolt run. Ten of them captured the oracle from build/jolt per case; their values are now literals (one env-dependent javastatic case became a predicate so it stays portable). The rest already had literal expecteds with a redundant build/jolt sanity check, now dropped. Retire emit-test/emit-parity/reader-parity: they compared the Chez/Clojure path against a live Janet evaluation, emitter, or reader. That migration check is done, and run-corpus-zero-janet (Chez analyzer vs the JVM corpus) plus certify.clj cover correctness now. Rewrite the README for the current zero-Janet gate. jolt-5oci
This commit is contained in:
parent
8d4f83e0f7
commit
9a273e71cd
21 changed files with 205 additions and 1510 deletions
|
|
@ -11,11 +11,11 @@
|
|||
# through the host seam).
|
||||
#
|
||||
# Outputs are order-stable (value-equality / scalars) so set/map iteration order
|
||||
# — which legitimately differs from build/jolt — never masquerades as a divergence.
|
||||
# Oracle = build/jolt.
|
||||
# — which is host-dependent — never masquerades as a divergence.
|
||||
#
|
||||
#
|
||||
# janet test/chez/_stdlib.janet
|
||||
(def jolt-bin (or (os/getenv "JOLT_BIN") "bin/jolt-chez"))
|
||||
(def jolt-bin (or (os/getenv "JOLT_BIN") "bin/joltc"))
|
||||
|
||||
(def cases
|
||||
[# --- clojure.math (jolt-22vo / jolt-h79) ---
|
||||
|
|
@ -31,7 +31,7 @@
|
|||
["(long (clojure.math/cbrt 27))" "3"]
|
||||
["(< 4.6 (clojure.math/log 100) 4.7)" "true"]
|
||||
# Chez has no native log10 (computed as log(x)/log(10)), so it can differ from
|
||||
# the seed's C log10 in the last ulp (3 vs 2.9999…); range-check, don't pin.
|
||||
# C log10 in the last ulp (3 vs 2.9999…); range-check, don't pin.
|
||||
["(< 2.99 (clojure.math/log10 1000) 3.01)" "true"]
|
||||
["(do (require (quote [clojure.math :as m])) (long (m/hypot 3 4)))" "5"]
|
||||
["(mapv (comp long clojure.math/sqrt) [1 4])" "[1 2]"]
|
||||
|
|
@ -63,11 +63,8 @@
|
|||
(var pass 0)
|
||||
(def fails @[])
|
||||
(each [expr expected] cases
|
||||
(def [ocode oracle _] (run-capture "build/jolt" expr))
|
||||
(def [code got err] (run-capture jolt-bin expr))
|
||||
(cond
|
||||
(not= ocode 0) (array/push fails [expr (string "ORACLE FAILED exit " ocode)])
|
||||
(not= oracle expected) (array/push fails [expr (string "ORACLE MISMATCH want `" expected "` got `" oracle "`")])
|
||||
(not= code 0) (array/push fails [expr (string "exit " code "; err: " err)])
|
||||
(= got expected) (++ pass)
|
||||
(array/push fails [expr (string "want `" expected "`, got `" got "`")])))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue