Files
multica/server/pkg/skillbundle/hash_test.go
Bohan Jiang 5038c983c0 MUL-3281: Add daemon skill bundle refs (#4445)
* feat: add daemon skill bundle refs

Co-authored-by: multica-agent <github@multica.ai>

* fix: tighten skill bundle resolve safeguards

Co-authored-by: multica-agent <github@multica.ai>

* feat: add task prepare lease

Co-authored-by: multica-agent <github@multica.ai>

* fix: isolate prepare lease concurrent index migration

Co-authored-by: multica-agent <github@multica.ai>

* fix: keep prepare lease active through start

Co-authored-by: multica-agent <github@multica.ai>

---------

Co-authored-by: J <j@multica.ai>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-23 16:19:16 +08:00

38 lines
962 B
Go

package skillbundle
import "testing"
func TestBuildManifestStableAcrossFileOrder(t *testing.T) {
a := BuildManifest(Skill{
ID: "skill-1",
Source: SourceWorkspace,
Name: "deploy",
Content: "main",
Files: []File{
{Path: "b.md", Content: "b"},
{Path: "a.md", Content: "a"},
},
})
b := BuildManifest(Skill{
ID: "skill-1",
Source: SourceWorkspace,
Name: "deploy",
Content: "main",
Files: []File{
{Path: "a.md", Content: "a"},
{Path: "b.md", Content: "b"},
},
})
if a.Hash != b.Hash {
t.Fatalf("hash depends on file order: %s != %s", a.Hash, b.Hash)
}
}
func TestBuildManifestChangesWhenContentChanges(t *testing.T) {
a := BuildManifest(Skill{ID: "skill-1", Source: SourceWorkspace, Name: "deploy", Content: "main"})
b := BuildManifest(Skill{ID: "skill-1", Source: SourceWorkspace, Name: "deploy", Content: "changed"})
if a.Hash == b.Hash {
t.Fatal("hash did not change when content changed")
}
}