chore: publish IntegraCI build modules a11ec75d3e09

This commit is contained in:
dhimaz0445 committed 2026-11-11 03:41:55 +00:00
1 parent 694710104a
commit 3c2b80914e
78 files changed
+4982 -405

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
package main
import "testing"
func TestParseLicencesListsPackagesWithoutDeciding(t *testing.T) {
report := `{"Results":[{"Licenses":[
{"PkgName":"left-pad","Name":"MIT"},
{"PkgName":"left-pad","Name":"MIT"},
{"PkgName":"gpl-thing","Name":"GPL-3.0"},
{"PkgName":"","Name":"Apache-2.0"}]}]}`
got, err := parseLicences(report)
if err != nil {
t.Fatal(err)
}
want := []PackageLicence{{"gpl-thing", "GPL-3.0"}, {"left-pad", "MIT"}}
if len(got) != len(want) || got[0] != want[0] || got[1] != want[1] {
t.Fatalf("got %v, want %v", got, want)
}
}
func TestAnUnreadableLicenceReportIsAnError(t *testing.T) {
if _, err := parseLicences("FATAL"); err == nil {
t.Fatal("an unreadable report must be could_not_run, not an empty list")
}
}