;; _hyperscript conformance test fixtures
;; Auto-extracted from https://github.com/bigskysoftware/_hyperscript (v0.9.14)
;; 222 pure expression tests (no DOM dependency)
;; Generated: 2026-04-08T17:44:00.716Z

;; ── eval-hs: compile + evaluate hyperscript source ──────────────────
(begin
  (define _hs-error "_HS_ERROR_")
  (define _hs-result nil)
  (define
    eval-hs-inner
    (fn
      (src ctx)
      (let
        ((sx (hs-to-sx (hs-compile src))))
        (let
          ((defaults (list (list (quote me) nil) (list (quote it) nil) (list (quote result) nil)))
            (runtime
              (list
                (list (quote hs-add) hs-add)
                (list (quote hs-falsy?) hs-falsy?)
                (list (quote hs-strict-eq) hs-strict-eq)
                (list (quote hs-type-check) hs-type-check)
                (list (quote hs-type-check-strict) hs-type-check-strict)
                (list (quote hs-matches?) hs-matches?)
                (list (quote hs-coerce) hs-coerce)
                (list (quote hs-contains?) hs-contains?)
                (list (quote hs-empty?) hs-empty?)
                (list (quote hs-first) hs-first)
                (list (quote hs-last) hs-last)
                (list (quote host-get) host-get)
                (list (quote hs-template) hs-template)
                (list (quote hs-make-object) hs-make-object)))
            (overrides (list)))
          (do
            (when
              ctx
              (do
                (when
                  (get ctx "me")
                  (set!
                    overrides
                    (cons (list (quote me) (get ctx "me")) overrides)))
                (when
                  (get ctx "locals")
                  (for-each
                    (fn
                      (k)
                      (set!
                        overrides
                        (cons
                          (list
                            (make-symbol k)
                            (list (quote quote) (get (get ctx "locals") k)))
                          overrides)))
                    (keys (get ctx "locals"))))))
            (set!
              _hs-result
              (eval-expr-cek
                (list
                  (quote let)
                  runtime
                  (list
                    (quote let)
                    defaults
                    (list
                      (quote let)
                      overrides
                      (list
                        (quote guard)
                        (list
                          (quote _e)
                          (list
                            (quote true)
                            (list
                              (quote if)
                              (list
                                (quote and)
                                (list (quote list?) (quote _e))
                                (list
                                  (quote =)
                                  (list (quote first) (quote _e))
                                  "hs-return"))
                              (list (quote nth) (quote _e) 1)
                              (list (quote raise) (quote _e)))))
                        sx)))))))))))
  (define
    eval-hs
    (fn
      (src &rest opts)
      (let
        ((ctx (if (> (len opts) 0) (first opts) nil)))
        (let
          ((tc-result (try-call (fn () (eval-hs-inner src ctx)))))
          (if
            (get tc-result "ok")
            _hs-result
            (str "_ERR_:" (get tc-result "error"))))))))

;; ── run-hs-fixture: evaluate one test case ────────────────────────────
(begin
  (define _hs-error "_HS_ERROR_")
  (define
    run-hs-fixture
    (fn
      (f)
      (let
        ((src (get f "src"))
          (expected (get f "expected"))
          (ctx (if (or (get f "locals") (get f "me")) {:me (get f "me") :locals (get f "locals")} nil)))
        (let
          ((result (if ctx (eval-hs src ctx) (eval-hs src))))
          (if
            (and (string? result) (starts-with? result "_ERR_:"))
            (assert false (str src " → " (slice result 6 (len result))))
            (assert= result expected src)))))))

;; ── arrayIndex (1 fixtures) ──────────────────────────────
(defsuite
  "hs-compat-arrayIndex"
  (deftest
    "can-create-an-array-literal"
    (for-each run-hs-fixture (list {:src "[1, 2, 3]" :expected (list 1 2 3)}))))

;; ── arrayLiteral (3 fixtures) ──────────────────────────────
(defsuite
  "hs-compat-arrayLiteral"
  (deftest
    "empty-array-literals-work"
    (for-each run-hs-fixture (list {:src "[]" :expected (list)})))
  (deftest
    "one-element-array-literal-works"
    (for-each run-hs-fixture (list {:src "[true]" :expected (list true)})))
  (deftest
    "multi-element-array-literal-works"
    (for-each run-hs-fixture (list {:src "[true, false]" :expected (list true false)}))))

;; ── asExpression (19 fixtures) ──────────────────────────────
(defsuite
  "hs-compat-asExpression"
  (deftest
    "converts-value-as-string"
    (for-each run-hs-fixture (list {:src "1 as String" :expected "1"} {:src "true as String" :expected "true"})))
  (deftest
    "converts-value-as-int"
    (for-each run-hs-fixture (list {:src "'10' as Int" :expected 10} {:src "10.5 as Int" :expected 10})))
  (deftest
    "converts-value-as-float"
    (for-each run-hs-fixture (list {:src "'10.5' as Float" :expected 10.5} {:src "10 as Float" :expected 10})))
  (deftest
    "converts-value-as-fixed"
    (for-each run-hs-fixture (list {:src "'10.4899' as Fixed:2" :expected "10.49"} {:src "10 as Fixed:0" :expected "10"})))
  (deftest
    "converts-value-as-number"
    (for-each run-hs-fixture (list {:src "'10' as Number" :expected 10} {:src "'3.14' as Number" :expected 3.14})))
  (deftest
    "converts-value-as-json"
    (for-each run-hs-fixture (list {:src "{foo:'bar'} as JSON" :expected "{\"foo\":\"bar\"}"})))
  (deftest
    "converts-string-as-object"
    (for-each run-hs-fixture (list {:src "x as Object" :locals {:x "{:foo \"bar\"}"} :expected "{:foo \"bar\"}"})))
  (deftest
    "can-use-the-an-modifier-if-you"
    (for-each run-hs-fixture (list {:src "x as an Object" :locals {:x "{:foo \"bar\"}"} :expected "{:foo \"bar\"}"})))
  (deftest
    "converts-value-as-object"
    (for-each run-hs-fixture (list {:src "x as Object" :locals {:x "bar"} :expected "bar"})))
  (deftest
    "converts-a-complete-form-into-values"
    (for-each run-hs-fixture (list {:src "x as Values" :locals {:x "test"} :expected "test"})))
  (deftest
    "converts-numbers-things-"
    (for-each run-hs-fixture (list {:src "value as HTML" :locals {:value 123} :expected "123"})))
  (deftest
    "converts-strings-into-fragments"
    (for-each run-hs-fixture (list {:src "value as Fragment" :locals {:value "hello"} :expected "hello"})))
  (deftest
    "can-accept-custom-conversions"
    (for-each run-hs-fixture (list {:src "1 as String" :expected "1"})))
  (deftest "converts-foo-bar" (for-each run-hs-fixture (list {:src "1 as String" :expected "1"}))))

;; ── blockLiteral (4 fixtures) ──────────────────────────────
(deftest
  "can-map-an-array"
  (let
    ((r (eval-hs "['a', 'ab', 'abc'].map(\\ s -> s.length)")))
    (assert= r (list 1 2 3) "map with block")))

;; ── boolean (2 fixtures) ──────────────────────────────
(defsuite
  "hs-compat-boolean"
  (deftest
    "true-boolean-literals-work"
    (for-each run-hs-fixture (list {:src "true" :expected true})))
  (deftest
    "false-boolean-literals-work"
    (for-each run-hs-fixture (list {:src "false" :expected false}))))

;; ── classRef (1 fixtures) ──────────────────────────────
(defsuite
  "hs-compat-classRef"
  (deftest
    "basic-classref-works-w-no-match"
    (let
      ((r (eval-hs ".badClassThatDoesNotHaveAnyElements")))
      (assert= (len r) 0 "empty class query"))))

;; ── comparisonOperator (113 fixtures) ──────────────────────────────
(defsuite
  "hs-compat-comparisonOperator"
  (deftest
    "less-than-works"
    (for-each run-hs-fixture (list {:src "1 < 2" :expected true} {:src "2 < 1" :expected false} {:src "2 < 2" :expected false})))
  (deftest
    "less-than-or-equal-works"
    (for-each run-hs-fixture (list {:src "1 <= 2" :expected true} {:src "2 <= 1" :expected false} {:src "2 <= 2" :expected true})))
  (deftest
    "greater-than-works"
    (for-each run-hs-fixture (list {:src "1 > 2" :expected false} {:src "2 > 1" :expected true} {:src "2 > 2" :expected false})))
  (deftest
    "greater-than-or-equal-works"
    (for-each run-hs-fixture (list {:src "1 >= 2" :expected false} {:src "2 >= 1" :expected true} {:src "2 >= 2" :expected true})))
  (deftest
    "equal-works"
    (for-each run-hs-fixture (list {:src "1 == 2" :expected false} {:src "2 == 1" :expected false} {:src "2 == 2" :expected true})))
  (deftest
    "triple-equal-works"
    (for-each run-hs-fixture (list {:src "1 === 2" :expected false} {:src "2 === 1" :expected false} {:src "2 === 2" :expected true})))
  (deftest
    "not-equal-works"
    (for-each run-hs-fixture (list {:src "1 != 2" :expected true} {:src "2 != 1" :expected true} {:src "2 != 2" :expected false})))
  (deftest
    "triple-not-equal-works"
    (for-each run-hs-fixture (list {:src "1 !== 2" :expected true} {:src "2 !== 1" :expected true} {:src "2 !== 2" :expected false})))
  (deftest
    "is-works"
    (for-each run-hs-fixture (list {:src "1 is 2" :expected false} {:src "2 is 1" :expected false} {:src "2 is 2" :expected true})))
  (deftest
    "equals-works"
    (for-each run-hs-fixture (list {:src "1 equals 2" :expected false} {:src "2 equals 1" :expected false} {:src "2 equals 2" :expected true})))
  (deftest
    "is-equal-to-works"
    (for-each run-hs-fixture (list {:src "1 is equal to 2" :expected false} {:src "2 is equal to 1" :expected false} {:src "2 is equal to 2" :expected true})))
  (deftest
    "is-really-equal-to-works"
    (for-each
      run-hs-fixture
      (list {:src "1 is really equal to 2" :expected false} {:src "2 is really equal to 1" :expected false} {:src "2 is really equal to '2'" :expected false} {:src "2 is really equal to 2" :expected true})))
  (deftest
    "really-equals-works"
    (for-each run-hs-fixture (list {:src "1 really equals 2" :expected false} {:src "2 really equals 1" :expected false} {:src "2 really equals 2" :expected true})))
  (deftest
    "is-not-works"
    (for-each run-hs-fixture (list {:src "1 is not 2" :expected true} {:src "2 is not 1" :expected true} {:src "2 is not 2" :expected false})))
  (deftest
    "is-not-equal-to-works"
    (for-each run-hs-fixture (list {:src "1 is not equal to 2" :expected true} {:src "2 is not equal to 1" :expected true} {:src "2 is not equal to 2" :expected false})))
  (deftest
    "is-not-really-equal-to-works"
    (for-each
      run-hs-fixture
      (list {:src "1 is not really equal to 2" :expected true} {:src "2 is not really equal to 1" :expected true} {:src "2 is not really equal to '2'" :expected true} {:src "2 is not really equal to 2" :expected false})))
  (deftest
    "is-in-works"
    (for-each
      run-hs-fixture
      (list {:src "1 is in [1, 2]" :expected true} {:src "2 is in [1, 2]" :expected true} {:src "3 is in [1, 2]" :expected false} {:src "3 is in null" :expected false})))
  (deftest
    "is-not-in-works"
    (for-each
      run-hs-fixture
      (list {:src "1 is not in [1, 2]" :expected false} {:src "2 is not in [1, 2]" :expected false} {:src "3 is not in [1, 2]" :expected true} {:src "3 is not in null" :expected true})))
  (deftest
    "i-am-in-works"
    (for-each
      run-hs-fixture
      (list {:src "I am in [1, 2]" :me 1 :expected true} {:src "I am in [1, 2]" :me 2 :expected true} {:src "I am in [1, 2]" :me 3 :expected false} {:src "I am in null" :expected false})))
  (deftest
    "i-am-not-in-works"
    (for-each
      run-hs-fixture
      (list {:src "I am not in [1, 2]" :me 1 :expected false} {:src "I am not in [1, 2]" :me 2 :expected false} {:src "I am not in [1, 2]" :me 3 :expected true} {:src "I am not in null" :expected true})))
  (deftest
    "match-works-w-strings"
    (for-each run-hs-fixture (list {:src "'a' matches '.*'" :expected true} {:src "'a' matches 'b'" :expected false})))
  (deftest
    "does-not-match-works-w-strings"
    (for-each run-hs-fixture (list {:src "'a' does not match '.*'" :expected false} {:src "'a' does not match 'b'" :expected true})))
  (deftest
    "is-empty-works"
    (for-each
      run-hs-fixture
      (list {:src "undefined is empty" :expected true} {:src "'' is empty" :expected true} {:src "[] is empty" :expected true} {:src "'not empty' is empty" :expected false} {:src "1000 is empty" :expected false} {:src "[1,2,3] is empty" :expected false})))
  (deftest
    "is-not-empty-works"
    (for-each
      run-hs-fixture
      (list {:src "undefined is not empty" :expected false} {:src "'' is not empty" :expected false} {:src "[] is not empty" :expected false} {:src "'not empty' is not empty" :expected true} {:src "1000 is not empty" :expected true} {:src "[1,2,3] is not empty" :expected true})))
  (deftest
    "is-a-works"
    (for-each run-hs-fixture (list {:src "null is a String" :expected true} {:src "null is a String!" :expected false} {:src "'' is a String!" :expected true})))
  (deftest
    "is-not-a-works"
    (for-each run-hs-fixture (list {:src "null is not a String" :expected false} {:src "null is not a String!" :expected true} {:src "'' is not a String!" :expected false})))
  (deftest
    "is-an-works"
    (for-each run-hs-fixture (list {:src "null is an String" :expected true} {:src "null is an String!" :expected false} {:src "'' is an String!" :expected true})))
  (deftest
    "is-not-an-works"
    (for-each run-hs-fixture (list {:src "null is not an String" :expected false} {:src "null is not an String!" :expected true} {:src "'' is not an String!" :expected false})))
  (deftest
    "english-less-than-works"
    (for-each run-hs-fixture (list {:src "1 is less than 2" :expected true} {:src "2 is less than 1" :expected false} {:src "2 is less than 2" :expected false})))
  (deftest
    "english-less-than-or-equal-works"
    (for-each run-hs-fixture (list {:src "1 is less than or equal to 2" :expected true} {:src "2 is less than or equal to 1" :expected false} {:src "2 is less than or equal to 2" :expected true})))
  (deftest
    "english-greater-than-works"
    (for-each run-hs-fixture (list {:src "1 is greater than 2" :expected false} {:src "2 is greater than 1" :expected true} {:src "2 is greater than 2" :expected false})))
  (deftest
    "english-greater-than-or-equal-works"
    (for-each run-hs-fixture (list {:src "1 is greater than or equal to 2" :expected false} {:src "2 is greater than or equal to 1" :expected true} {:src "2 is greater than or equal to 2" :expected true})))
  (deftest
    "does-not-exist-works"
    (for-each run-hs-fixture (list {:src "undefined does not exist" :expected true} {:src "null does not exist" :expected true}))))

;; ── cookies (9 fixtures) ──────────────────────────────
(deftest
  "update-cookie-values-work"
  (for-each run-hs-fixture (list {:src "cookies.foo" :locals {:cookies {:foo "doh"}} :expected "doh"})))

;; ── in (4 fixtures) ──────────────────────────────
(defsuite
  "hs-compat-in"
  (deftest
    "basic-no-query-return-values"
    (for-each
      run-hs-fixture
      (list {:src "1 in [1, 2, 3]" :expected true} {:src "4 in [1, 2, 3]" :expected false} {:src "'a' in 'abc'" :expected true} {:src "'z' in 'abc'" :expected false}))))

;; ── logicalOperator (2 fixtures) ──────────────────────────────
(defsuite
  "hs-compat-logicalOperator"
  (deftest
    "should-short-circuit-with-and-expression"
    (for-each run-hs-fixture (list {:src "false and true" :expected false})))
  (deftest
    "should-short-circuit-with-or-expression"
    (for-each run-hs-fixture (list {:src "false or true" :expected true}))))

;; ── mathOperator (8 fixtures) ──────────────────────────────
(defsuite
  "hs-compat-mathOperator"
  (deftest "addition-works" (for-each run-hs-fixture (list {:src "1 + 1" :expected 2})))
  (deftest "string-concat-works" (for-each run-hs-fixture (list {:src "'a' + 'b'" :expected "ab"})))
  (deftest "subtraction-works" (for-each run-hs-fixture (list {:src "1 - 1" :expected 0})))
  (deftest
    "multiplication-works"
    (for-each run-hs-fixture (list {:src "1 * 2" :expected 2})))
  (deftest "division-works" (for-each run-hs-fixture (list {:src "1 / 2" :expected 0.5})))
  (deftest "mod-works" (for-each run-hs-fixture (list {:src "3 mod 2" :expected 1})))
  (deftest
    "addition-works-w-more-than-one-value"
    (for-each run-hs-fixture (list {:src "1 + 2 + 3" :expected 6})))
  (deftest
    "parenthesized-expressions-with-multiple-operators-work"
    (for-each run-hs-fixture (list {:src "1 + (2 * 3)" :expected 7}))))

;; ── no (5 fixtures) ──────────────────────────────
(defsuite
  "hs-compat-no"
  (deftest
    "no-returns-true-for-null"
    (for-each run-hs-fixture (list {:src "no null" :expected true})))
  (deftest
    "no-returns-false-for-non-null"
    (for-each run-hs-fixture (list {:src "no 'hello'" :expected false} {:src "no 1" :expected false})))
  (deftest
    "no-returns-true-for-empty-array"
    (for-each run-hs-fixture (list {:src "no []" :expected true})))
  (deftest
    "no-returns-true-for-empty-selector"
    (let
      ((r (eval-hs "no .aClassThatDoesNotExist")))
      (assert= r true "empty selector no → true"))))

;; ── not (3 fixtures) ──────────────────────────────
(defsuite
  "hs-compat-not"
  (deftest "not-inverts-true" (for-each run-hs-fixture (list {:src "not true" :expected false})))
  (deftest "not-inverts-false" (for-each run-hs-fixture (list {:src "not false" :expected true})))
  (deftest
    "two-nots-make-a-true"
    (for-each run-hs-fixture (list {:src "not not true" :expected true}))))

;; ── numbers (4 fixtures) ──────────────────────────────
(defsuite
  "hs-compat-numbers"
  (deftest
    "handles-numbers-properly"
    (for-each run-hs-fixture (list {:src "1" :expected 1} {:src "3.14" :expected 3.14} {:src "100" :expected 100})))
  (deftest
    "handles-large-numbers"
    (let
      ((r (eval-hs "1234567890.1234567890")))
      (assert= (> r 1234567890) true "large decimal"))))

;; ── objectLiteral (3 fixtures) ──────────────────────────────
(defsuite
  "hs-compat-objectLiteral"
  (deftest
    "empty-object-literals-work"
    (let
      ((r (eval-hs "{}")))
      (assert= (type-of r) "dict" "empty obj is dict")))
  (deftest
    "hyphens-work-in-object-literal-field-names"
    (let
      ((r (eval-hs "{foo:true, bar-baz:false}")))
      (assert= (get r "foo") true "foo is true")))
  (deftest
    "allows-trailing-commans"
    (let
      ((r (eval-hs "{foo:true, bar-baz:false,}")))
      (assert= (get r "foo") true "foo trailing comma"))))

;; ── positionalExpression (2 fixtures) ──────────────────────────────
(defsuite
  "hs-compat-positionalExpression"
  (deftest "first-works" (for-each run-hs-fixture (list {:src "the first of [1, 2, 3]" :expected 1})))
  (deftest "last-works" (for-each run-hs-fixture (list {:src "the last of [1, 2, 3]" :expected 3}))))

;; ── possessiveExpression (2 fixtures) ──────────────────────────────
(defsuite
  "hs-compat-possessiveExpression"
  (deftest
    "can-access-basic-properties"
    (for-each run-hs-fixture (list {:src "foo's foo" :locals {:foo {:foo "foo"}} :expected "foo"})))
  (deftest
    "can-access-its-properties"
    (for-each run-hs-fixture (list {:src "its foo" :locals {:it {:foo "foo"}} :expected "foo"}))))

;; ── propertyAccess (4 fixtures) ──────────────────────────────
(defsuite
  "hs-compat-propertyAccess"
  (deftest
    "can-access-basic-properties"
    (for-each run-hs-fixture (list {:src "foo.foo" :locals {:foo {:foo "bar"}} :expected "bar"})))
  (deftest "of-form-works" (for-each run-hs-fixture (list {:src "foo of bar" :locals {:bar {:foo "baz"}} :expected "baz"})))
  (deftest
    "of-form-works-w-complex-left-side"
    (for-each run-hs-fixture (list {:src "doh of foo.bar" :locals {:foo {:bar {:doh "baz"}}} :expected "baz"})))
  (deftest
    "of-form-works-w-complex-right-side"
    (for-each run-hs-fixture (list {:src "doh of foo.bar" :locals {:foo {:bar {:doh "quux"}}} :expected "quux"}))))

;; ── queryRef (1 fixtures) ──────────────────────────────
(defsuite
  "hs-compat-queryRef"
  (deftest
    "basic-queryref-works-w-no-match"
    (let
      ((r (eval-hs "<.badClassThatDoesNotHaveAnyElements/>")))
      (assert= (len r) 0 "empty query result"))))

;; ── some (6 fixtures) ──────────────────────────────
(deftest
  "some-returns-true-for-nonempty-selector"
  (for-each run-hs-fixture (list {:src "some [1]" :expected true})))

;; ── stringPostfix (10 fixtures) ──────────────────────────────
(defsuite
  "hs-compat-stringPostfix"
  (deftest
    "handles-basic-postfix-strings-properly"
    (for-each
      run-hs-fixture
      (list {:src "1em" :expected "1em"} {:src "1px" :expected "1px"} {:src "2vh" :expected "2vh"} {:src "100vw" :expected "100vw"})))
  (deftest
    "handles-basic-postfix-strings-with-spaces-properly"
    (for-each run-hs-fixture (list {:src "1 em" :expected "1em"} {:src "10 px" :expected "10px"} {:src "2 vh" :expected "2vh"})))
  (deftest
    "handles-expression-roots-properly"
    (for-each run-hs-fixture (list {:src "1 + 2" :expected 3}))))

;; ── strings (11 fixtures) ──────────────────────────────
(defsuite
  "hs-compat-strings"
  (deftest
    "handles-strings-properly"
    (for-each run-hs-fixture (list {:src "\"foo\"" :expected "foo"} {:src "\"fo'o\"" :expected "fo'o"} {:src "'foo'" :expected "foo"})))
  (deftest
    "string-templates-work-properly"
    (for-each run-hs-fixture (list {:src "`$x`" :locals {:x 1} :expected "1"})))
  (deftest
    "string-templates-work-properly-w-braces"
    (for-each run-hs-fixture (list {:src "`${1 + 2}`" :expected "3"})))
  (deftest
    "string-templates-preserve-white-space"
    (for-each run-hs-fixture (list {:src "` ${1 + 2} ${1 + 2} `" :expected " 3 3 "})))
  (deftest
    "should-handle-strings-with-tags-and-quotes"
    (for-each run-hs-fixture (list {:src "`<div>${record.name}</div>`" :locals {:record {:name "John Connor"}} :expected "<div>John Connor</div>"})))
  (deftest
    "should-handle-back-slashes-in-non-template-content"
    (for-each run-hs-fixture (list {:src "`https://${foo}`" :locals {:foo "bar"} :expected "https://bar"}))))

;; ── symbol (1 fixtures) ──────────────────────────────
(defsuite
  "hs-compat-symbol"
  (deftest
    "resolves-local-context-properly"
    (for-each run-hs-fixture (list {:src "foo" :locals {:foo 42} :expected 42}))))

;; ── typecheck (4 fixtures) ──────────────────────────────
(defsuite
  "hs-compat-typecheck"
  (deftest
    "can-do-basic-string-typecheck"
    (for-each run-hs-fixture (list {:src "'foo' : String" :expected true})))
  (deftest
    "can-do-basic-non-string-typecheck-failure"
    (for-each run-hs-fixture (list {:src "true : String" :expected false})))
  (deftest
    "can-do-basic-string-non-null-typecheck"
    (for-each run-hs-fixture (list {:src "'foo' : String!" :expected true})))
  (deftest
    "null-causes-null-safe-string-check-to-fail"
    (for-each run-hs-fixture (list {:src "null : String!" :expected false}))))

(defsuite
  "hs-extra-numbers"
  (deftest "null-literal" (for-each run-hs-fixture (list {:src "null" :expected nil})))
  (deftest "negative" (for-each run-hs-fixture (list {:src "-1" :expected -1})))
  (deftest "decimal" (for-each run-hs-fixture (list {:src "1.1" :expected 1.1})))
  (deftest "sci-notation" (for-each run-hs-fixture (list {:src "1e6" :expected 1000000})))
  (deftest "sci-neg" (for-each run-hs-fixture (list {:src "1e-6" :expected 1e-06})))
  (deftest "decimal-sci" (for-each run-hs-fixture (list {:src "1.1e6" :expected 1100000})))
  (deftest "decimal-sci-neg" (for-each run-hs-fixture (list {:src "1.1e-6" :expected 1.1e-06})))
  (deftest
    "large-decimal"
    (let
      ((r (eval-hs "1234567890.1234567890")))
      (assert= (> r 1234567890) true "large decimal"))))

(defsuite
  "hs-extra-as"
  (deftest "null-as-string" (for-each run-hs-fixture (list {:src "null as String" :expected ""})))
  (deftest "10-as-string" (for-each run-hs-fixture (list {:src "10 as String" :expected "10"})))
  (deftest "10.4-as-float" (for-each run-hs-fixture (list {:src "'10.4' as Float" :expected 10.4})))
  (deftest "10.4-as-int" (for-each run-hs-fixture (list {:src "'10.4' as Int" :expected 10})))
  (deftest "10.4-as-number" (for-each run-hs-fixture (list {:src "'10.4' as Number" :expected 10.4})))
  (deftest "10-as-fixed-0" (for-each run-hs-fixture (list {:src "10 as Fixed:0" :expected "10"})))
  (deftest "as-html" (for-each run-hs-fixture (list {:src "value as HTML" :locals {:value 123} :expected "123"})))
  (deftest "as-date" (for-each run-hs-fixture (list {:src "value as String" :locals {:value 2024} :expected "2024"}))))

(defsuite
  "hs-0990-chain-via-locals"
  (deftest
    "where-then-join"
    (let
      ((filtered (eval-hs "[1,2,3,4,5] where it > 2")))
      (let
        ((r (eval-hs "items joined by ','" {:locals {:items filtered}})))
        (assert= r "3,4,5" "chain")))))

(defsuite
  "hs-extra-no-some"
  (deftest "no-string" (for-each run-hs-fixture (list {:src "no 'thing'" :expected false})))
  (deftest "no-array" (for-each run-hs-fixture (list {:src "no ['thing']" :expected false})))
  (deftest "some-null" (for-each run-hs-fixture (list {:src "some null" :expected false})))
  (deftest "some-empty-arr" (for-each run-hs-fixture (list {:src "some []" :expected false})))
  (deftest "some-string" (for-each run-hs-fixture (list {:src "some 'thing'" :expected true})))
  (deftest "some-array" (for-each run-hs-fixture (list {:src "some ['thing']" :expected true})))
  (deftest
    "no-class"
    (let
      ((r (eval-hs "no .aClassThatDoesNotExist")))
      (assert= r true "no empty")))
  (deftest
    "some-class"
    (let
      ((r (eval-hs "some .aClassThatDoesNotExist")))
      (assert= r false "some empty"))))

(defsuite
  "hs-extra-objects"
  (deftest
    "empty-obj"
    (let ((r (eval-hs "{}"))) (assert= (type-of r) "dict" "empty")))
  (deftest
    "single-key"
    (let ((r (eval-hs "{foo:true}"))) (assert= (get r "foo") true "foo")))
  (deftest
    "multi-key"
    (let
      ((r (eval-hs "{foo:true, bar:false}")))
      (assert= (get r "bar") false "bar")))
  (deftest
    "quoted-keys"
    (let
      ((r (eval-hs "{\"foo\":true}")))
      (assert= (get r "foo") true "quoted")))
  (deftest
    "hyphen-keys"
    (let
      ((r (eval-hs "{foo:true, bar-baz:false}")))
      (assert= (get r "foo") true "hyphens")))
  (deftest
    "trailing-comma"
    (let
      ((r (eval-hs "{foo:true, bar:false,}")))
      (assert= (get r "foo") true "trailing"))))

(defsuite
  "hs-extra-postfix"
  (deftest "em" (for-each run-hs-fixture (list {:src "1em" :expected "1em"})))
  (deftest "px" (for-each run-hs-fixture (list {:src "1px" :expected "1px"})))
  (deftest "pct" (for-each run-hs-fixture (list {:src "100%" :expected "100%"})))
  (deftest "space-em" (for-each run-hs-fixture (list {:src "1 em" :expected "1em"})))
  (deftest "space-px" (for-each run-hs-fixture (list {:src "1 px" :expected "1px"})))
  (deftest "neg-px" (for-each run-hs-fixture (list {:src "-1 px" :expected "-1px"})))
  (deftest "expr-em" (for-each run-hs-fixture (list {:src "(0 + 1) em" :expected "1em"})))
  (deftest "expr-px" (for-each run-hs-fixture (list {:src "(0 + 1) px" :expected "1px"})))
  (deftest "expr-pct" (for-each run-hs-fixture (list {:src "(100 + 0) %" :expected "100%"}))))

(defsuite
  "hs-extra-property"
  (deftest "my-foo" (for-each run-hs-fixture (list {:src "my foo" :me {:foo "bar"} :expected "bar"})))
  (deftest "foo-of-foo" (for-each run-hs-fixture (list {:src "foo of foo" :locals {:foo {:foo "baz"}} :expected "baz"})))
  (deftest "doh-of-foo-bar" (for-each run-hs-fixture (list {:src "doh of foo.bar" :locals {:foo {:bar {:doh "baz"}}} :expected "baz"})))
  (deftest "first-of-arr" (for-each run-hs-fixture (list {:src "the first of [1, 2, 3]" :expected 1})))
  (deftest "last-of-arr" (for-each run-hs-fixture (list {:src "the last of [1, 2, 3]" :expected 3}))))

(defsuite
  "hs-extra-function-call"
  (deftest "identity-call" (for-each run-hs-fixture (list {:src "identity('foo')" :locals {:identity (fn (x) x)} :expected "foo"})))
  (deftest
    "obj-method"
    (let
      ((r (eval-hs "obj.getValue()" {:locals {:obj {:getValue "test"}}})))
      (assert= (type-of r) "nil" "method"))))

(defsuite
  "hs-extra-containment"
  (deftest "list-contains-item" (for-each run-hs-fixture (list {:src "x contains y" :locals {:x (list 1 2 3) :y 2} :expected true})))
  (deftest "item-in-list" (for-each run-hs-fixture (list {:src "y is in x" :locals {:x (list 1 2 3) :y 2} :expected true})))
  (deftest "arr-in-arr" (for-each run-hs-fixture (list {:src "[1, 3] in [1, 2, 3]" :expected (list 1 3)})))
  (deftest "arr-in-arr-partial" (for-each run-hs-fixture (list {:src "[1, 3, 4] in [1, 2, 3]" :expected (list 1 3)})))
  (deftest
    "arr-in-arr-none"
    (let
      ((r (eval-hs "[4, 5, 6] in [1, 2, 3]")))
      (assert= (len r) 0 "none"))))

(defsuite
  "hs-extra-lambda"
  (deftest "arrow-true" (for-each run-hs-fixture (list {:src "\\ -> true" :expected true})))
  (deftest
    "arrow-identity"
    (let
      ((r (eval-hs "\\ x -> x")))
      (assert= (type-of r) "lambda" "identity")))
  (deftest
    "arrow-two-arg"
    (let
      ((r (eval-hs "\\ x, y -> y")))
      (assert= (type-of r) "lambda" "two-arg")))
  (deftest
    "array-map-block"
    (let
      ((r (eval-hs "['a', 'ab', 'abc'].map(\\ s -> s.length)")))
      (assert= r (list 1 2 3) "map"))))

(defsuite
  "hs-extra-dom-query"
  (deftest
    "class-no-match"
    (let ((r (eval-hs ".badClass"))) (assert= (len r) 0 "empty")))
  (deftest
    "query-no-match"
    (let ((r (eval-hs "<.badClass/>"))) (assert= (len r) 0 "empty"))))

(defsuite
  "hs-extra-templates"
  (deftest "simple-var" (for-each run-hs-fixture (list {:src "`$x`" :locals {:x 42} :expected "42"})))
  (deftest "braces-expr" (for-each run-hs-fixture (list {:src "`${1 + 2}`" :expected "3"})))
  (deftest "spacing" (for-each run-hs-fixture (list {:src "` ${1 + 2} ${1 + 2} `" :expected " 3 3 "})))
  (deftest "record-access" (for-each run-hs-fixture (list {:src "`<div>${r.name}</div>`" :locals {:r {:name "John"}} :expected "<div>John</div>"})))
  (deftest "url" (for-each run-hs-fixture (list {:src "`https://${foo}`" :locals {:foo "bar"} :expected "https://bar"}))))

(defsuite
  "hs-extra-typecheck"
  (deftest "null-colon-string" (for-each run-hs-fixture (list {:src "null : String" :expected true})))
  (deftest "null-not-exist" (for-each run-hs-fixture (list {:src "null does not exist" :expected true})))
  (deftest "undef-not-exist" (for-each run-hs-fixture (list {:src "undefined does not exist" :locals {:undefined nil} :expected true}))))

(deftest
  "where-with-property"
  (let
    ((items (list {:age 15 :name "Alice"} {:age 30 :name "Bob"})))
    (let
      ((r (eval-hs "items where its age > 20" {:locals {:items items}})))
      (assert= (len r) 1 "one match"))))

(defsuite
  "hs-0990-collection-ops"
  (deftest "sorted-by" (for-each run-hs-fixture (list {:src "[3,1,2] sorted by it" :expected (list 1 2 3)})))
  (deftest "sorted-by-desc" (for-each run-hs-fixture (list {:src "[3,1,2] sorted by it descending" :expected (list 3 2 1)})))
  (deftest "mapped-to" (for-each run-hs-fixture (list {:src "[1,2,3] mapped to (it * 2)" :expected (list 2 4 6)})))
  (deftest "split-by" (for-each run-hs-fixture (list {:src "'a,b,c' split by ','" :expected (list "a" "b" "c")})))
  (deftest "joined-by" (for-each run-hs-fixture (list {:src "[1,2,3] joined by '-'" :expected "1-2-3"})))
  (deftest "chained-map-join" (for-each run-hs-fixture (list {:src "[1,2,3] mapped to (it * 10) joined by ','" :expected "10,20,30"}))))

(defsuite
  "hs-0990-array-slice"
  (deftest "index" (for-each run-hs-fixture (list {:src "[10,20,30][1]" :expected 20})))
  (deftest "slice-range" (for-each run-hs-fixture (list {:src "[10,20,30,40][1..2]" :expected (list 20 30)})))
  (deftest "slice-from-start" (for-each run-hs-fixture (list {:src "[10,20,30,40][..1]" :expected (list 10 20)})))
  (deftest "slice-to-end" (for-each run-hs-fixture (list {:src "[10,20,30,40][2..]" :expected (list 30 40)}))))

(defsuite
  "hs-0990-misc"
  (deftest "beep-passthrough" (for-each run-hs-fixture (list {:src "beep! 42" :expected 42})))
  (deftest "prop-is-true" (for-each run-hs-fixture (list {:src "x is cool" :locals {:x {:cool true}} :expected true})))
  (deftest "prop-is-false" (for-each run-hs-fixture (list {:src "x is cool" :locals {:x {:cool false}} :expected false})))
  (deftest "prop-is-missing" (for-each run-hs-fixture (list {:src "x is cool" :locals {:x {:hot true}} :expected false}))))

;; ── Summary ──────────────────────────────────────────────────────────
;; 24 suites, 112 tests, 222 fixtures

