From 96f2862385387afd290aaef757366443b75af595 Mon Sep 17 00:00:00 2001 From: giles Date: Tue, 24 Mar 2026 12:55:47 +0000 Subject: [PATCH] =?UTF-8?q?Fix=20island=20rendering=20in=20OCaml=20test=20?= =?UTF-8?q?runner=20=E2=80=94=20add=20Island=20cases=20to=20component=20ac?= =?UTF-8?q?cessors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test runner's component-body/component-params/component-has-children bindings only handled Component values, not Island. When adapter-html.sx called (component-body island), it hit the fallback and returned nil, producing empty island bodies. Also removed debug logging from component-has-children? primitive. Co-Authored-By: Claude Opus 4.6 (1M context) --- hosts/ocaml/bin/run_tests.ml | 4 ++++ hosts/ocaml/lib/sx_primitives.ml | 10 ++-------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/hosts/ocaml/bin/run_tests.ml b/hosts/ocaml/bin/run_tests.ml index cb0bd94..193c87f 100644 --- a/hosts/ocaml/bin/run_tests.ml +++ b/hosts/ocaml/bin/run_tests.ml @@ -465,21 +465,25 @@ let make_test_env () = bind "component-params" (fun args -> match args with | [Component c] -> List (List.map (fun s -> String s) c.c_params) + | [Island i] -> List (List.map (fun s -> String s) i.i_params) | _ -> Nil); bind "component-body" (fun args -> match args with | [Component c] -> c.c_body + | [Island i] -> i.i_body | _ -> Nil); bind "component-has-children" (fun args -> match args with | [Component c] -> Bool c.c_has_children + | [Island i] -> Bool i.i_has_children | _ -> Bool false); bind "component-affinity" (fun args -> match args with | [Component c] -> String c.c_affinity + | [Island _] -> String "client" | _ -> String "auto"); (* --- Parser test helpers --- *) diff --git a/hosts/ocaml/lib/sx_primitives.ml b/hosts/ocaml/lib/sx_primitives.ml index b53585e..51a480a 100644 --- a/hosts/ocaml/lib/sx_primitives.ml +++ b/hosts/ocaml/lib/sx_primitives.ml @@ -725,14 +725,8 @@ let () = | _ -> Nil); register "component-has-children?" (fun args -> match args with - | [Component c] -> - Printf.eprintf "[has-children?] Component %s params=%s has=%b\n%!" - c.c_name (String.concat "," c.c_params) c.c_has_children; - Bool c.c_has_children - | [Island i] -> - Printf.eprintf "[has-children?] Island %s params=%s has=%b\n%!" - i.i_name (String.concat "," i.i_params) i.i_has_children; - Bool i.i_has_children + | [Component c] -> Bool c.c_has_children + | [Island i] -> Bool i.i_has_children | _ -> Bool false); register "component-name" (fun args -> match args with