some cleanup

This commit is contained in:
udo
2026-04-28 12:10:07 +00:00
parent 223cf4c6e1
commit cd445f3c9b
224 changed files with 1558 additions and 38907 deletions
+3
View File
@@ -23,6 +23,7 @@ RENDER(Request& context)
bool exists = component_exists("components/panel");
String resolved = component_resolve("components/panel");
String panel_markup = component("components/panel", props, context);
String alias_markup = component("components/props_alias", props, context);
ob_start();
component_render("components/panel:FOOTER", props, context);
@@ -37,12 +38,14 @@ RENDER(Request& context)
check("component_exists()", exists, exists ? "components/panel resolved as existing" : "components/panel missing");
check("component_resolve()", resolved != "", resolved);
check("component()", panel_markup.find("Component Output") != String::npos && panel_markup.find("This body comes from component()") != String::npos, panel_markup);
check("COMPONENT(Request& props) alias", alias_markup.find("alias=Component Output") != String::npos && alias_markup.find("body=This body comes from component()") != String::npos, alias_markup);
check("component_render() named handler", footer_markup.find("Named footer render") != String::npos, footer_markup);
check("ob_start() / ob_get_close()", buffer_markup == "buffered-text", buffer_markup);
?><div class="tests-section">
<h3>Rendered Component</h3>
<?: panel_markup ?>
<?: alias_markup ?>
</div><?
site_tests_summary(passed, failed, skipped, "The panel fixture under site/tests/components exercises default and named component entry points.");
@@ -1,4 +1,4 @@
COMPONENT(Request& context)
{
<><pre class="tests-code-block"><?: first(context.call["default_html"].to_string(), context.call["children_html"].to_string()) ?></pre></>
<><pre class="tests-code-block"><?: first(context.props["default_html"].to_string(), context.props["children_html"].to_string()) ?></pre></>
}
+1 -1
View File
@@ -1,4 +1,4 @@
COMPONENT(Request& context)
{
<><div class="tests-warning"><?= first(context.call["children_html"].to_string(), context.call["default_html"].to_string()) ?></div></>
<><div class="tests-warning"><?= first(context.props["children_html"].to_string(), context.props["default_html"].to_string()) ?></div></>
}
+6 -6
View File
@@ -1,23 +1,23 @@
COMPONENT(Request& context)
{
<><section class="tests-component">
<? component_render(":HEADER", context.call, context); ?>
<? component_render(":BODY", context.call, context); ?>
<? component_render(":FOOTER", context.call, context); ?>
<? component_render(":HEADER", context.props, context); ?>
<? component_render(":BODY", context.props, context); ?>
<? component_render(":FOOTER", context.props, context); ?>
</section></>
}
COMPONENT:HEADER(Request& context)
{
<><h3 class="accent"><?= first(context.call["title"].to_string(), "Missing Title") ?></h3></>
<><h3 class="accent"><?= first(context.props["title"].to_string(), "Missing Title") ?></h3></>
}
COMPONENT:BODY(Request& context)
{
<><p><?= first(context.call["body"].to_string(), "Missing Body") ?></p></>
<><p><?= first(context.props["body"].to_string(), "Missing Body") ?></p></>
}
COMPONENT:FOOTER(Request& context)
{
<><small><?= first(context.call["footer"].to_string(), "Missing Footer") ?></small></>
<><small><?= first(context.props["footer"].to_string(), "Missing Footer") ?></small></>
}
+10
View File
@@ -0,0 +1,10 @@
COMPONENT(Request& props)
{
String title = props.props["title"].to_string();
String body = props.props["body"].to_string();
<><div class="panel panel-alias-check">
<strong>alias=<?= title ?></strong>
<p>body=<?= body ?></p>
</div></>
}
-35
View File
@@ -1,35 +0,0 @@
#include "testlib.h"
RENDER(Request& context)
{
bool local_only = test_demo_request_allowed(context);
site_tests_page_start(
"Coverage Index",
"Grouped runtime coverage pages for the published site. Public-safe pages stay available everywhere; stateful or infrastructure-touching pages stay local-only."
);
if(local_only)
{
?><div class="tests-note">Local-network access detected. The full suite, including filesystem, service, and task coverage pages, is available.</div><?
}
else
{
?><div class="tests-note">Public access detected. Local-only pages remain linked here but will return a restricted message instead of mutating server state.</div><?
}
?><div class="tests-grid"><?
site_tests_card("core.uce", "Core APIs", "Strings, UTF-8 handling, DTree, JSON, and small pure-function helpers.", "public");
site_tests_card("http.uce", "HTTP And Session", "Headers, cookies, query parsing, URI helpers, and session lifecycle checks.", "public");
site_tests_card("components.uce", "Components", "component_exists(), component_resolve(), component(), component_render(), and output buffering.", "public");
site_tests_card("markdown.uce", "Markdown", "markdown_to_ast(), markdown_to_html(), and component hook rendering.", "public");
site_tests_card("units.uce", "Units", "units_list(), unit_info(), unit_call(), unit_render(), and fixture loading.", "public");
site_tests_card("websockets.ws.uce", "WebSockets", "Browser-driven handshake and echo checks for ws_* helpers.", "public");
site_tests_card("io.uce", "Filesystem", "path_join(), file_put_contents(), file_append(), and file_get_contents().", "local-only");
site_tests_card("services.uce", "Sockets And Services", "socket_*, memcache_*, and MySQL reachability probes with skip-aware output.", "local-only");
site_tests_card("tasks.uce", "Tasks", "task(), task_pid(), task_repeat(), and task_kill() health checks.", "local-only");
?></div><?
?><div class="tests-section"><a class="button" href="../demo/index.uce">Back To Demo Pages</a></div><?
site_tests_page_end();
}