;; lib/ocaml/tests/tokenize.sx — smoke-test helpers.
;;
;; Tests are exercised via lib/ocaml/test.sh, which drives sx_server.exe
;; over the epoch protocol. This file provides small accessors so the
;; bash runner can grep short diagnostic values out of one batched run.

(define
  ocaml-test-tok-type
  (fn (src i) (get (nth (ocaml-tokenize src) i) :type)))

(define
  ocaml-test-tok-value
  (fn (src i) (get (nth (ocaml-tokenize src) i) :value)))

(define ocaml-test-tok-count (fn (src) (len (ocaml-tokenize src))))

(define ocaml-test-parse-str (fn (src) (ocaml-parse src)))

(define
  ocaml-test-parse-head
  (fn (src) (nth (ocaml-parse src) 0)))
