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{"