mirror of
https://github.com/anchore/syft.git
synced 2026-11-03 16:06:36 +01:00
fix: stop omitting redundantly parenthesized licenses in CDX formatter (#3517)
Previously, a bug in the formatter would cause SPDX expressions that were surrounded in redundant parentheses to be dropped instead of normalized. Signed-off-by: Will Murphy <willmurphyscode@users.noreply.github.com>
This commit is contained in:
@@ -20,6 +20,11 @@ func TestParseExpression(t *testing.T) {
|
||||
expression: "MIT OR Apache-2.0",
|
||||
want: "MIT OR Apache-2.0",
|
||||
},
|
||||
{
|
||||
name: "accept redundant parentheses",
|
||||
expression: "(MIT OR Apache-2.0)",
|
||||
want: "(MIT OR Apache-2.0)",
|
||||
},
|
||||
{
|
||||
name: "Invalid SPDX expression returns error",
|
||||
expression: "MIT OR Apache-2.0 OR invalid",
|
||||
|
||||
Reference in New Issue
Block a user