jolt/test/integration/ports/cljs-port-3b-test.janet
Yogthos 16428179fa test: restructure into unit / integration / spec layers + shared harness
Reorganize the flat 49-file test/ into three layers (jpm test recurses, so all
are still discovered):
- test/unit/        white-box component tests (reader, evaluator, types,
                    persistent-map, lazy-seq, macro, interop, compiler)
- test/integration/ cross-cutting + regression batteries (conformance, jank,
                    sci-bootstrap/runtime, features, systematic-coverage, api,
                    core, namespaces, ported clojure suites) and
   .../ports/       ported clojure/cljs test batches pending consolidation
- test/spec/        the behavioral contract (built out in following commits)
- test/support/harness.janet  shared defspec table runner (cases compared via
                    Jolt's own =, with a :throws sentinel) + expect= helpers

Files moved with git mv (history preserved) and import paths fixed for depth.
jpm test green. README Test section updated.

Next: build out test/spec/ to cover the public API area-by-area, mining the
integration batteries and filling gaps.
2026-06-05 00:00:16 -04:00

22 lines
1 KiB
Text

(use ../../../src/jolt/api)
(defn ct-eval [ctx s] (normalize-pvecs (eval-string ctx s)))
(print "=== CLJS Ported Part 3b ===")
(print "21: clojure.string...")
(let [ctx (init)]
(load-string ctx (slurp "src/jolt/clojure/string.clj"))
(assert (= true (ct-eval ctx "(blank? nil)")) "blank? nil")
(assert (= true (ct-eval ctx "(blank? \" \")")) "blank? spaces")
(assert (= "Abc" (ct-eval ctx "(capitalize \"abc\")")) "capitalize")
(assert (= "hello" (ct-eval ctx "(lower-case \"HELLO\")")) "lower-case")
(assert (= "hello" (ct-eval ctx "(trim \" hello \")")) "trim"))
(print " passed")
(print "22: clojure.set...")
(let [ctx (init)]
(load-string ctx (slurp "src/jolt/clojure/set.clj"))
(assert (= 3 (ct-eval ctx "(count (union #{1 2} #{2 3}))")) "union")
(assert (= 1 (ct-eval ctx "(count (intersection #{1 2} #{2 3}))")) "intersection")
(assert (= 1 (ct-eval ctx "(count (difference #{1 2} #{2 3}))")) "difference"))
(print " passed")
(print "\nAll CLJS Ported Part 3 tests passed!")
(print "\nAll CLJS Ported Part 3b tests passed!")