nix-openclaw-tools/cmd/update-tools/main_test.go
joshp123 a0e7ac5ef1 package qmd for OpenClaw tools
What:
- add a source-built qmd package and plugin metadata
- add a no-model-download qmd smoke check
- teach update-tools to notice qmd releases and the new sonoscli asset names

Why:
- nix-openclaw needs QMD as an internal runtime battery on Darwin and Linux
- the maintainer automation should not require a separate manual qmd bump path

Tests:
- nix build .#qmd .#checks.aarch64-darwin.qmd-smoke --accept-flake-config --no-link
- nix shell nixpkgs#go --command go test ./...
2026-05-06 09:31:57 +02:00

34 lines
643 B
Go

package main
import "testing"
func TestQMDNodeModulesHash(t *testing.T) {
upstream := `
nodeModulesHashes = {
x86_64-linux = "sha256-linux";
aarch64-darwin = "sha256-darwin";
};
`
got, err := qmdNodeModulesHash(upstream, "aarch64-darwin")
if err != nil {
t.Fatal(err)
}
if got != "sha256-darwin" {
t.Fatalf("got %q", got)
}
}
func TestQMDNodeModulesHashRejectsFake(t *testing.T) {
upstream := `
nodeModulesHashes = {
aarch64-darwin = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
};
`
_, err := qmdNodeModulesHash(upstream, "aarch64-darwin")
if err == nil {
t.Fatal("expected fake hash to be rejected")
}
}