Share artifact dependency queries across consumers

This commit is contained in:
2026-12-02 21:20:01 +00:00
parent 0965b7c7ac
commit 19b720742e
27 changed files with 194 additions and 205 deletions

View File

@@ -1,6 +1,7 @@
package artifactdeps
import (
"encoding/json"
"errors"
"reflect"
"testing"
@@ -18,6 +19,10 @@ func TestGraphQueries(t *testing.T) {
if err != nil {
t.Fatal(err)
}
serialized, err := json.Marshal(g.Dependencies("root"))
if err != nil || string(serialized) != "[]" {
t.Fatalf("empty dependency JSON = %s, %v", serialized, err)
}
wantOrder := []string{"other", "root", "left", "right", "end"}
if got := g.Order(); !reflect.DeepEqual(got, wantOrder) {
t.Fatalf("order = %v", got)