Round 2 T1, T2, T5: the contracts end G with no more tests than at their merge base; fixtures name roles
The test that read every fixture for the operator's account and a node goes (T1); the tests G added fold into existing ones as subtests, so each module counts its merge base (design 47 G §626, A-306); node names in the lines G adds are role names (T5). Builds: design 47 G §626, A-306; review round 2 findings T1, T2, T5 Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
This commit is contained in:
@@ -58,22 +58,21 @@ func TestHaveCodec(t *testing.T) {
|
||||
if _, err := DecodeHave([]byte(`{"v":1,"phase":"running","health":"ok","extra":1}`)); err == nil {
|
||||
t.Fatal("an unknown field is read")
|
||||
}
|
||||
}
|
||||
|
||||
func TestSameHaveComparesTimesAsInstants(t *testing.T) {
|
||||
at := time.Date(2026, 11, 5, 12, 0, 0, 0, time.UTC)
|
||||
zone := time.FixedZone("x", 3600)
|
||||
mk := func(tm time.Time) seat.HaveByNodeModuleValue {
|
||||
return seat.HaveByNodeModuleValue{Phase: PhaseFailed, Health: HealthFailed,
|
||||
PullWait: &seat.PullWait{Image: "i", Holder: "h", Began: tm},
|
||||
UserList: &seat.UserListWritten{Source: "s", At: tm}}
|
||||
}
|
||||
if !SameHave(mk(at), mk(at.In(zone))) {
|
||||
t.Fatal("the same instant in another zone differs")
|
||||
}
|
||||
if SameHave(mk(at), mk(at.Add(time.Second))) {
|
||||
t.Fatal("another instant is the same")
|
||||
}
|
||||
t.Run("SameHaveComparesTimesAsInstants", func(t *testing.T) {
|
||||
at := time.Date(2026, 11, 5, 12, 0, 0, 0, time.UTC)
|
||||
zone := time.FixedZone("x", 3600)
|
||||
mk := func(tm time.Time) seat.HaveByNodeModuleValue {
|
||||
return seat.HaveByNodeModuleValue{Phase: PhaseFailed, Health: HealthFailed,
|
||||
PullWait: &seat.PullWait{Image: "i", Holder: "h", Began: tm},
|
||||
UserList: &seat.UserListWritten{Source: "s", At: tm}}
|
||||
}
|
||||
if !SameHave(mk(at), mk(at.In(zone))) {
|
||||
t.Fatal("the same instant in another zone differs")
|
||||
}
|
||||
if SameHave(mk(at), mk(at.Add(time.Second))) {
|
||||
t.Fatal("another instant is the same")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func TestHaveNodeCodec(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user