mirror of
https://gh-proxy.org/https://github.com/klinsmaya/multica.git
synced 2026-11-09 01:46:46 +08:00
* 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]>
23 lines
654 B
Go
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)
|
|
}
|
|
}
|