INNER CODE UNIT · Go
TestScoopManifestIsValidJSON
Bharath-code/git-scope · git-scope_test.go:9
func TestScoopManifestIsValidJSON(t *testing.T) {
data, err := os.ReadFile("git-scope.json")
if err != nil {
t.Fatalf("failed to read git-scope.json: %v", err)
}
var manifest map[string]interface{}
if err := json.Unmarshal(data, &manifest); err != nil {
t.Fatalf("git-scope.json is not valid JSON: %v", err)
}
requiredFields := []string{"version", "description", "homepage", "license", "architecture", "bin", "checkver", "autoupdate"}
for _, field := range requiredFields {
if _, ok := manifest[field]; !ok {
t.Errorf("missing required field: %s", field)
}
}