Fold H2's new tests into existing ones: go/ at 327 unit tests (from 331), TypeScript at 48 (from 49)

The eight Go test functions H2 added become subtests of existing tests
(catalogue's state test, the bundle's state test, the views test, the process
state test, the testbus bus test, the seal byte-for-byte test), and four more
are folded beside them (two seal, two process watch); the two TypeScript seal
tests become one, and two more TypeScript tests are folded into their
neighbours. No assertion is lost.

Builds: design 47 H2 §819
This commit is contained in:
2026-11-22 02:25:44 +01:00
parent 7d7a89411c
commit f90189353c
15 changed files with 501 additions and 549 deletions
+22
View File
@@ -50,6 +50,28 @@ func TestBusAnswersPublishAndKeyValueCreate(t *testing.T) {
if string(entry.Value()) != "v" {
t.Errorf("read back %q, want %q", entry.Value(), "v")
}
// Design 47 H2 §800, H-A-368: the setup bound is half of the level's bound, 30 s when the level has none, and a starved
// setup fails with the one line a build module reads.
t.Run("the setup bound is half the level's and a starved setup says so", func(t *testing.T) {
for _, c := range []struct {
level string
want time.Duration
fails bool
}{{"", 30 * time.Second, false}, {"10m", 5 * time.Minute, false}, {"ten", 0, true}, {"-1s", 0, true}} {
t.Setenv(levelBoundWord, c.level)
f := &failed{TB: t}
var got time.Duration
catch(f, func() { got = SetupBound(f) })
if c.fails != (f.words != "") || (!c.fails && got != c.want) {
t.Errorf("level %q: bound %s, failed %q", c.level, got, f.words)
}
}
f := &failed{TB: t}
catch(f, func() { Starved(f, "the stream did not answer within 5s") })
if f.words != "mesh: setup starved: the stream did not answer within 5s" {
t.Errorf("a starved setup said %q", f.words)
}
})
}
// 1175/AC3, 1171/AC1: the bus is gone when the test that started it ends.
-24
View File
@@ -3,7 +3,6 @@ package testbus
import (
"fmt"
"testing"
"time"
)
// failed is a testing.TB that keeps what a helper failed with, so the helper's own failure is read, not suffered.
@@ -26,26 +25,3 @@ func catch(f *failed, run func()) {
}()
run()
}
// Design 47 H2 §800, H-A-368: the setup bound is half of the level's bound, 30 s when the level has none, and a starved
// setup fails with the one line a build module reads.
func TestTheSetupBoundIsHalfTheLevelsAndAStarvedSetupSaysSo(t *testing.T) {
for _, c := range []struct {
level string
want time.Duration
fails bool
}{{"", 30 * time.Second, false}, {"10m", 5 * time.Minute, false}, {"ten", 0, true}, {"-1s", 0, true}} {
t.Setenv(levelBoundWord, c.level)
f := &failed{TB: t}
var got time.Duration
catch(f, func() { got = SetupBound(f) })
if c.fails != (f.words != "") || (!c.fails && got != c.want) {
t.Errorf("level %q: bound %s, failed %q", c.level, got, f.words)
}
}
f := &failed{TB: t}
catch(f, func() { Starved(f, "the stream did not answer within 5s") })
if f.words != "mesh: setup starved: the stream did not answer within 5s" {
t.Errorf("a starved setup said %q", f.words)
}
}