package grants import ( "slices" "testing" "git.novox.be/novox/mesh-sdk/go/catalogue" ) // Design 47 G §406, §631, A-108: the catch-up tools a manifest's kept data name are the module's own, each once, whichever // kind of kept data names them. func TestCatchUpsAreTheToolsTheManifestsKeptDataName(t *testing.T) { m, err := catalogue.Decode([]byte(`{"module":"keeper","version":"1.0","state":[{"name":"seen","form":2,"catch-up":{"tool":"seen_again","arguments":{"all":true}}},"plain"],` + `"logs":[{"name":"lines","form":1,"catch-up":"seen_again"}],"streams":[{"name":"ev","events":["a"],"max-age-days":1,"max-mib":1,"form":1,"catch-up":{"tool":"ev_again"}}]}`)) if err != nil { t.Fatal(err) } if got := catchUpsOf(m); !slices.Equal(got, []string{"seen_again", "ev_again"}) && !slices.Equal(got, []string{"ev_again", "seen_again"}) { t.Errorf("catchUpsOf = %v, want seen_again and ev_again once each", got) } }