Files
multica/server/pkg/pluginruntime/runtime_test.go
T
d467cc9069 MUL-6075: complete Plugin V1 execution chain (#6853)
* feat(server): add Plugin V1 lifecycle foundation

Co-authored-by: multica-agent <[email protected]>

* feat(server): complete Plugin V1 execution chain

Co-authored-by: multica-agent <[email protected]>

* feat(web): add temporary plugin settings demo

Co-authored-by: multica-agent <[email protected]>

* refactor(plugin): keep foundation free of demo content

Co-authored-by: multica-agent <[email protected]>

---------

Co-authored-by: Lambda <[email protected]>
Co-authored-by: multica-agent <[email protected]>
2026-08-13 02:29:49 +08:00

23 lines
654 B
Go

package pluginruntime
import "testing"
func TestSnapshotDigestCanonicalizesEntryOrder(t *testing.T) {
left := []CompiledEntry{
{PluginKey: "z.plugin", ContributionKey: "b", Ordinal: 1, RequiredDaemonFeatures: []string{"b", "a"}},
{PluginKey: "a.plugin", ContributionKey: "a", Ordinal: 0},
}
right := []CompiledEntry{left[1], left[0]}
first, err := SnapshotDigest(map[string]int64{"b": 2, "a": 1}, left)
if err != nil {
t.Fatal(err)
}
second, err := SnapshotDigest(map[string]int64{"a": 1, "b": 2}, right)
if err != nil {
t.Fatal(err)
}
if first != second {
t.Fatalf("snapshot digest is not canonical: %s != %s", first, second)
}
}