From 67b04f3ae5ebd72c996872fba4e288645720ac23 Mon Sep 17 00:00:00 2001 From: Kevin Tang <73975146+vt128@users.noreply.github.com> Date: Mon, 22 Jun 2026 14:07:56 +0800 Subject: [PATCH] [test] e2e domain-module integration: sqlite CRUD, markdown, gum (STAR-53) Extend the e2e golden suite to prove the offline-testable domain modules actually do their job through the CLI, not merely load (the last P0 gap from the cost-price audit's "domain modules only load-verified" finding): - sqlite: a real local in-memory CRUD round-trip (connect ":memory:" -> CREATE/insert/query) returns the stored value - markdown: convert() renders HTML - gum: the headless table renders without a TTY Full -race green; Docker golang:1.25 floor builds + runs the binary in-container. --- e2e/e2e_test.go | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/e2e/e2e_test.go b/e2e/e2e_test.go index 5d5340b..64f9554 100644 --- a/e2e/e2e_test.go +++ b/e2e/e2e_test.go @@ -110,3 +110,52 @@ func TestGolden(t *testing.T) { }) } } + +// TestDomainModuleIntegration proves the offline-testable domain modules +// actually *do their job* through the CLI — not merely that they load. sqlite +// runs a real local CRUD round-trip, markdown renders HTML, and gum's headless +// table renders without a TTY. +func TestDomainModuleIntegration(t *testing.T) { + cases := []struct { + name string + args []string + outSub []string // stdout must contain each of these + }{ + { + name: "sqlite local CRUD round-trip", + args: []string{"-c", ` +load("sqlite", "connect") +db = connect(":memory:") +db.execute("CREATE TABLE t (id INTEGER PRIMARY KEY, name TEXT)") +db.insert("t", {"name": "Ada"}) +print(db.query("SELECT name FROM t")[0]["name"]) +db.close() +`}, + outSub: []string{"Ada"}, + }, + { + name: "markdown renders HTML", + args: []string{"-c", `load("markdown", "convert"); print(convert(text="# Hi"))`}, + outSub: []string{"