node-engine seat: a node's windows, busy, strays and filters are lists, as the engine writes them (the contract said objects and refused every real value; ADR 0634; issue 1966)
Claude-Session: https://claude.ai/code/session_01NcbgfFSnn24M3GcqttoU7i
This commit is contained in:
@@ -148,3 +148,16 @@ func TestHealthAndDataCodecs(t *testing.T) {
|
||||
t.Errorf("node key %q %v", k, err)
|
||||
}
|
||||
}
|
||||
|
||||
// The lists a node's facts carry (windows, busy, strays, filters) are arrays on the bus, as the engine has always written
|
||||
// them; the contract once said objects and refused every real value.
|
||||
func TestHaveNodeReadsTheListsTheEngineWrites(t *testing.T) {
|
||||
raw := []byte(`{"v":1,"windows":[{"step":"backup"}],"busy":[{"id":"x"}],"strays":[{"kind":"container"}],"filters":[{"name":"f"}]}`)
|
||||
n, err := DecodeHaveNode(raw)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if len(n.Windows) != 1 || len(n.Busy) != 1 || len(n.Strays) != 1 || len(n.Filters) != 1 {
|
||||
t.Fatalf("lists lost: %+v", n)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user