mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 08:23:15 +01:00
Update the license_list.go to have more permissible inputs for greater SPDXID matching. EX: GPL3 gpl3 gpl-3 and GPL-3 can all map to GPL-3.0-only By moving all strings to lower and removing the "-" we're able to return valid SPDX license ID for a greater diversity of input strings. --------- Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
17 lines
404 B
Go
17 lines
404 B
Go
package spdxlicense
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestLicenceListIDs(t *testing.T) {
|
|
// do a sanity check on the generated data
|
|
assert.Equal(t, "0BSD", licenseIDs["0bsd"])
|
|
assert.Equal(t, "ZPL-2.1", licenseIDs["zpl2.1"])
|
|
assert.Equal(t, "GPL-2.0-only", licenseIDs["gpl2"])
|
|
assert.Equal(t, "GPL-2.0-or-later", licenseIDs["gpl2+"])
|
|
assert.NotEmpty(t, Version)
|
|
}
|