aboutsummaryrefslogtreecommitdiff
path: root/reporter/reporter_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'reporter/reporter_test.go')
-rw-r--r--reporter/reporter_test.go52
1 files changed, 26 insertions, 26 deletions
diff --git a/reporter/reporter_test.go b/reporter/reporter_test.go
index 919e46b..c0d7940 100644
--- a/reporter/reporter_test.go
+++ b/reporter/reporter_test.go
@@ -13,19 +13,19 @@ import (
func TestReporterCanMakeReportFromPackage(t *testing.T) {
pkg := &spdx.Package2_1{
FilesAnalyzed: true,
- Files: []*spdx.File2_1{
- &spdx.File2_1{LicenseConcluded: "MIT"},
- &spdx.File2_1{LicenseConcluded: "NOASSERTION"},
- &spdx.File2_1{LicenseConcluded: "MIT"},
- &spdx.File2_1{LicenseConcluded: "MIT"},
- &spdx.File2_1{LicenseConcluded: "GPL-2.0-only"},
- &spdx.File2_1{LicenseConcluded: "NOASSERTION"},
- &spdx.File2_1{LicenseConcluded: "GPL-2.0-only"},
- &spdx.File2_1{LicenseConcluded: "GPL-2.0-only"},
- &spdx.File2_1{LicenseConcluded: "MIT"},
- &spdx.File2_1{LicenseConcluded: "GPL-2.0-only"},
- &spdx.File2_1{LicenseConcluded: "GPL-2.0-only"},
- &spdx.File2_1{LicenseConcluded: "NOASSERTION"},
+ Files: map[spdx.ElementID]*spdx.File2_1{
+ spdx.ElementID("File0"): &spdx.File2_1{FileSPDXIdentifier: "File0", LicenseConcluded: "MIT"},
+ spdx.ElementID("File1"): &spdx.File2_1{FileSPDXIdentifier: "File1", LicenseConcluded: "NOASSERTION"},
+ spdx.ElementID("File2"): &spdx.File2_1{FileSPDXIdentifier: "File2", LicenseConcluded: "MIT"},
+ spdx.ElementID("File3"): &spdx.File2_1{FileSPDXIdentifier: "File3", LicenseConcluded: "MIT"},
+ spdx.ElementID("File4"): &spdx.File2_1{FileSPDXIdentifier: "File4", LicenseConcluded: "GPL-2.0-only"},
+ spdx.ElementID("File5"): &spdx.File2_1{FileSPDXIdentifier: "File5", LicenseConcluded: "NOASSERTION"},
+ spdx.ElementID("File6"): &spdx.File2_1{FileSPDXIdentifier: "File6", LicenseConcluded: "GPL-2.0-only"},
+ spdx.ElementID("File7"): &spdx.File2_1{FileSPDXIdentifier: "File7", LicenseConcluded: "GPL-2.0-only"},
+ spdx.ElementID("File8"): &spdx.File2_1{FileSPDXIdentifier: "File8", LicenseConcluded: "MIT"},
+ spdx.ElementID("File9"): &spdx.File2_1{FileSPDXIdentifier: "File9", LicenseConcluded: "GPL-2.0-only"},
+ spdx.ElementID("File10"): &spdx.File2_1{FileSPDXIdentifier: "File10", LicenseConcluded: "GPL-2.0-only"},
+ spdx.ElementID("File11"): &spdx.File2_1{FileSPDXIdentifier: "File11", LicenseConcluded: "NOASSERTION"},
},
}
@@ -71,19 +71,19 @@ func TestReporterReturnsErrorIfPackageFilesNotAnalyzed(t *testing.T) {
func TestCanGetCountsOfLicenses(t *testing.T) {
pkg := &spdx.Package2_1{
FilesAnalyzed: true,
- Files: []*spdx.File2_1{
- &spdx.File2_1{LicenseConcluded: "MIT"},
- &spdx.File2_1{LicenseConcluded: "NOASSERTION"},
- &spdx.File2_1{LicenseConcluded: "MIT"},
- &spdx.File2_1{LicenseConcluded: "MIT"},
- &spdx.File2_1{LicenseConcluded: "GPL-2.0-only"},
- &spdx.File2_1{LicenseConcluded: "NOASSERTION"},
- &spdx.File2_1{LicenseConcluded: "GPL-2.0-only"},
- &spdx.File2_1{LicenseConcluded: "GPL-2.0-only"},
- &spdx.File2_1{LicenseConcluded: "MIT"},
- &spdx.File2_1{LicenseConcluded: "GPL-2.0-only"},
- &spdx.File2_1{LicenseConcluded: "GPL-2.0-only"},
- &spdx.File2_1{LicenseConcluded: "NOASSERTION"},
+ Files: map[spdx.ElementID]*spdx.File2_1{
+ spdx.ElementID("File0"): &spdx.File2_1{FileSPDXIdentifier: "File0", LicenseConcluded: "MIT"},
+ spdx.ElementID("File1"): &spdx.File2_1{FileSPDXIdentifier: "File1", LicenseConcluded: "NOASSERTION"},
+ spdx.ElementID("File2"): &spdx.File2_1{FileSPDXIdentifier: "File2", LicenseConcluded: "MIT"},
+ spdx.ElementID("File3"): &spdx.File2_1{FileSPDXIdentifier: "File3", LicenseConcluded: "MIT"},
+ spdx.ElementID("File4"): &spdx.File2_1{FileSPDXIdentifier: "File4", LicenseConcluded: "GPL-2.0-only"},
+ spdx.ElementID("File5"): &spdx.File2_1{FileSPDXIdentifier: "File5", LicenseConcluded: "NOASSERTION"},
+ spdx.ElementID("File6"): &spdx.File2_1{FileSPDXIdentifier: "File6", LicenseConcluded: "GPL-2.0-only"},
+ spdx.ElementID("File7"): &spdx.File2_1{FileSPDXIdentifier: "File7", LicenseConcluded: "GPL-2.0-only"},
+ spdx.ElementID("File8"): &spdx.File2_1{FileSPDXIdentifier: "File8", LicenseConcluded: "MIT"},
+ spdx.ElementID("File9"): &spdx.File2_1{FileSPDXIdentifier: "File9", LicenseConcluded: "GPL-2.0-only"},
+ spdx.ElementID("File10"): &spdx.File2_1{FileSPDXIdentifier: "File10", LicenseConcluded: "GPL-2.0-only"},
+ spdx.ElementID("File11"): &spdx.File2_1{FileSPDXIdentifier: "File11", LicenseConcluded: "NOASSERTION"},
},
}