Fix island rendering in OCaml test runner — add Island cases to component accessors

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) <noreply@anthropic.com>
This commit is contained in:
2026-03-24 12:55:47 +00:00
parent 26e16f6aa4
commit 96f2862385
2 changed files with 6 additions and 8 deletions

View File

@@ -465,21 +465,25 @@ let make_test_env () =
bind "component-params" (fun args -> bind "component-params" (fun args ->
match args with match args with
| [Component c] -> List (List.map (fun s -> String s) c.c_params) | [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); | _ -> Nil);
bind "component-body" (fun args -> bind "component-body" (fun args ->
match args with match args with
| [Component c] -> c.c_body | [Component c] -> c.c_body
| [Island i] -> i.i_body
| _ -> Nil); | _ -> Nil);
bind "component-has-children" (fun args -> bind "component-has-children" (fun args ->
match args with match args with
| [Component c] -> Bool c.c_has_children | [Component c] -> Bool c.c_has_children
| [Island i] -> Bool i.i_has_children
| _ -> Bool false); | _ -> Bool false);
bind "component-affinity" (fun args -> bind "component-affinity" (fun args ->
match args with match args with
| [Component c] -> String c.c_affinity | [Component c] -> String c.c_affinity
| [Island _] -> String "client"
| _ -> String "auto"); | _ -> String "auto");
(* --- Parser test helpers --- *) (* --- Parser test helpers --- *)

View File

@@ -725,14 +725,8 @@ let () =
| _ -> Nil); | _ -> Nil);
register "component-has-children?" (fun args -> register "component-has-children?" (fun args ->
match args with match args with
| [Component c] -> | [Component c] -> Bool c.c_has_children
Printf.eprintf "[has-children?] Component %s params=%s has=%b\n%!" | [Island i] -> Bool i.i_has_children
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
| _ -> Bool false); | _ -> Bool false);
register "component-name" (fun args -> register "component-name" (fun args ->
match args with match args with