Inline test runner: 5/5 temperature converter tests passing
Fixed three fundamental issues: 1. cek-try arg passing: handler was called with raw string instead of (List [String msg]), causing "lambda expects 1 args, got N" errors 2. Silent island hydration failures: hydrate-island now wraps body render in cek-try, displaying red error box with stack trace instead of empty div. No more silent failures. 3. swap! thunk leak: apply result wasn't trampolined, storing thunks as signal values instead of evaluated results Also fixed: assert= uses = instead of equal? for value comparison, assert-signal-value uses deref instead of signal-value, HTML entity decoding in script tag test source via host-call replaceAll. Temperature converter demo page now shows live test results: ✓ initial celsius is 20 ✓ computed fahrenheit = celsius * 1.8 + 32 ✓ +5 increments celsius ✓ fahrenheit updates on celsius change ✓ multiple clicks accumulate 1116/1116 OCaml tests pass. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
(define assert (fn (condition msg) (when (not condition) (error (or msg "Assertion failed")))))
|
||||
|
||||
(define assert= (fn (actual expected msg) (when (not (equal? actual expected)) (error (or msg (str "Expected " expected ", got " actual))))))
|
||||
(define assert= (fn (actual expected msg) (when (not (= actual expected)) (error (or msg (str "Expected " expected ", got " actual))))))
|
||||
|
||||
(define default-platform {:current-user (fn () nil) :csrf-token (fn () "test-csrf-token") :app-url (fn (service &rest path) "/mock-app-url") :frag (fn (service comp &rest args) "") :sleep (fn (ms) nil) :local-storage-set (fn (key val) nil) :set-cookie (fn (name val &rest opts) nil) :url-for (fn (endpoint &rest args) "/mock-url") :create-element (fn (tag) nil) :request-path (fn () "/") :config (fn (key) nil) :set-attr (fn (el name val) nil) :set-text (fn (el text) nil) :remove-child (fn (parent child) nil) :fetch (fn (url &rest opts) {:status 200 :body "" :ok true}) :query (fn (service name &rest args) (list)) :add-class (fn (el cls) nil) :get-element (fn (id) nil) :now (fn () 0) :abort (fn (code) nil) :action (fn (service name &rest args) {:ok true}) :remove-class (fn (el cls) nil) :append-child (fn (parent child) nil) :request-arg (fn (name) nil) :emit-dom (fn (op &rest args) nil) :local-storage-get (fn (key) nil) :get-cookie (fn (name) nil)})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user