@@ -104,6 +104,32 @@ func TestSatisfies(t *testing.T) {
104
104
"MIT AND (GPL-2.0 OR ISC)" , []string {"MIT" }, false , nil },
105
105
{"! (MIT OR Apache-2.0) AND (ISC OR GPL-2.0) satisfies [MIT]" ,
106
106
"(MIT OR Apache-2.0) AND (ISC OR GPL-2.0)" , []string {"MIT" }, false , nil },
107
+ {"licenseRef is expression" ,
108
+ "LicenseRef-X-BSD-3-Clause-Golang" , []string {"MIT" , "Apache-2.0" , "LicenseRef-X-BSD-3-Clause-Golang" }, true , nil },
109
+ {"licenseRef in expression" ,
110
+ "MIT AND LicenseRef-X-BSD-3-Clause-Golang" , []string {"MIT" , "Apache-2.0" , "LicenseRef-X-BSD-3-Clause-Golang" }, true , nil },
111
+ {"licenseRef not in expression" ,
112
+ "MIT AND Apache-2.0" , []string {"MIT" , "Apache-2.0" , "LicenseRef-X-BSD-3-Clause-Golang" }, true , nil },
113
+ {"licenseRef not allowed" ,
114
+ "MIT AND LicenseRef-X-BSD-3-Clause-Golang" , []string {"MIT" , "Apache-2.0" }, false , nil },
115
+ {"licenseRef with documentRef is expression" ,
116
+ "DocumentRef-spdx-tool-1.2:LicenseRef-X-BSD-3-Clause-Golang" ,
117
+ []string {"MIT" , "Apache-2.0" , "DocumentRef-spdx-tool-1.2:LicenseRef-X-BSD-3-Clause-Golang" }, true , nil },
118
+ {"licenseRef with documentRef in expression" ,
119
+ "MIT AND DocumentRef-spdx-tool-1.2:LicenseRef-X-BSD-3-Clause-Golang" ,
120
+ []string {"MIT" , "Apache-2.0" , "DocumentRef-spdx-tool-1.2:LicenseRef-X-BSD-3-Clause-Golang" }, true , nil },
121
+ {"licenseRef with documentRef not in expression" ,
122
+ "MIT AND Apache-2.0" ,
123
+ []string {"MIT" , "Apache-2.0" , "DocumentRef-spdx-tool-1.2:LicenseRef-X-BSD-3-Clause-Golang" }, true , nil },
124
+ {"licenseRef with documentRef not allowed" ,
125
+ "MIT AND DocumentRef-spdx-tool-1.2:LicenseRef-X-BSD-3-Clause-Golang" ,
126
+ []string {"MIT" , "Apache-2.0" }, false , nil },
127
+ {"licenseRef allowed, but documentRef not allowed" ,
128
+ "MIT AND DocumentRef-spdx-tool-1.2:LicenseRef-X-BSD-3-Clause-Golang" ,
129
+ []string {"MIT" , "Apache-2.0" , "LicenseRef-X-BSD-3-Clause-Golang" }, false , nil },
130
+ {"licenseRef alone not allowed, but with documentRef allowed" ,
131
+ "MIT AND LicenseRef-X-BSD-3-Clause-Golang" ,
132
+ []string {"MIT" , "Apache-2.0" , "DocumentRef-spdx-tool-1.2:LicenseRef-X-BSD-3-Clause-Golang" }, false , nil },
107
133
}
108
134
109
135
for _ , test := range tests {
0 commit comments