This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

core / spindle / engines / microvm / cid_test.go
630 B 30 lines
1package microvm 2 3import ( 4 "testing" 5) 6 7func TestBuildConfigKeyScopesByRepo(t *testing.T) { 8 spec := ImageSpec{BaseConfigHash: "deadbeef"} 9 cfg := manifestConfig{Dependencies: []string{"nodejs"}} 10 11 a, err := buildConfigKey(spec, cfg, "did:plc:aaa") 12 if err != nil { 13 t.Fatal(err) 14 } 15 b, err := buildConfigKey(spec, cfg, "did:plc:bbb") 16 if err != nil { 17 t.Fatal(err) 18 } 19 if a == b { 20 t.Errorf("same config in different repos produced the same key %q", a) 21 } 22 23 again, err := buildConfigKey(spec, cfg, "did:plc:aaa") 24 if err != nil { 25 t.Fatal(err) 26 } 27 if a != again { 28 t.Errorf("key not deterministic: %q vs %q", a, again) 29 } 30}