@@ -20,9 +20,12 @@ func TestCompareGT(t *testing.T) {
20
20
{"expect greater than: AGPL-3.0 > AGPL-1.0" , getLicenseNode ("AGPL-3.0" , false ), getLicenseNode ("AGPL-1.0" , false ), true },
21
21
{"expect equal: GPL-2.0-or-later > GPL-2.0-only" , getLicenseNode ("GPL-2.0-or-later" , true ), getLicenseNode ("GPL-2.0-only" , false ), false },
22
22
{"expect equal: GPL-2.0-or-later > GPL-2.0" , getLicenseNode ("GPL-2.0-or-later" , true ), getLicenseNode ("GPL-2.0" , false ), false },
23
+ {"expect equal: GPL-2.0-only > GPL-2.0" , getLicenseNode ("GPL-2.0-only" , false ), getLicenseNode ("GPL-2.0" , false ), false },
23
24
{"expect equal: GPL-3.0 > GPL-3.0" , getLicenseNode ("GPL-3.0" , false ), getLicenseNode ("GPL-3.0" , false ), false },
25
+ {"expect equal: MIT > MIT" , getLicenseNode ("MIT" , false ), getLicenseNode ("MIT" , false ), false },
24
26
{"expect less than: MPL-1.0 > MPL-2.0" , getLicenseNode ("MPL-1.0" , false ), getLicenseNode ("MPL-2.0" , false ), false },
25
27
{"incompatible: MIT > ISC" , getLicenseNode ("MIT" , false ), getLicenseNode ("ISC" , false ), false },
28
+ {"incompatible: MIT > GPL-2.0-only" , getLicenseNode ("MIT" , false ), getLicenseNode ("GPL-2.0-only" , false ), false },
26
29
{"incompatible: OSL-1.0 > OPL-1.0" , getLicenseNode ("OSL-1.0" , false ), getLicenseNode ("OPL-1.0" , false ), false },
27
30
{"not simple license: (MIT OR ISC) > GPL-3.0" , getLicenseNode ("(MIT OR ISC)" , false ), getLicenseNode ("GPL-3.0" , false ), false }, // TODO: should it raise error?
28
31
}
@@ -49,9 +52,12 @@ func TestCompareEQ(t *testing.T) {
49
52
{"expect greater than: AGPL-3.0 == AGPL-1.0" , getLicenseNode ("AGPL-3.0" , false ), getLicenseNode ("AGPL-1.0" , false ), false },
50
53
{"expect equal: GPL-2.0-or-later > GPL-2.0-only" , getLicenseNode ("GPL-2.0-or-later" , true ), getLicenseNode ("GPL-2.0-only" , false ), true },
51
54
{"expect equal: GPL-2.0-or-later > GPL-2.0" , getLicenseNode ("GPL-2.0-or-later" , true ), getLicenseNode ("GPL-2.0" , false ), true },
55
+ {"expect equal: GPL-2.0-only == GPL-2.0" , getLicenseNode ("GPL-2.0-only" , false ), getLicenseNode ("GPL-2.0" , false ), true },
52
56
{"expect equal: GPL-3.0 == GPL-3.0" , getLicenseNode ("GPL-3.0" , false ), getLicenseNode ("GPL-3.0" , false ), true },
57
+ {"expect equal: MIT == MIT" , getLicenseNode ("MIT" , false ), getLicenseNode ("MIT" , false ), true },
53
58
{"expect less than: MPL-1.0 == MPL-2.0" , getLicenseNode ("MPL-1.0" , false ), getLicenseNode ("MPL-2.0" , false ), false },
54
59
{"incompatible: MIT == ISC" , getLicenseNode ("MIT" , false ), getLicenseNode ("ISC" , false ), false },
60
+ {"incompatible: MIT == GPL-2.0-only" , getLicenseNode ("MIT" , false ), getLicenseNode ("GPL-2.0-only" , false ), false },
55
61
{"incompatible: OSL-1.0 == OPL-1.0" , getLicenseNode ("OSL-1.0" , false ), getLicenseNode ("OPL-1.0" , false ), false },
56
62
{"not simple license: (MIT OR ISC) == GPL-3.0" , getLicenseNode ("(MIT OR ISC)" , false ), getLicenseNode ("GPL-3.0" , false ), false }, // TODO: should it raise error?
57
63
}
@@ -78,9 +84,12 @@ func TestCompareLT(t *testing.T) {
78
84
{"expect greater than: AGPL-3.0 < AGPL-1.0" , getLicenseNode ("AGPL-3.0" , false ), getLicenseNode ("AGPL-1.0" , false ), false },
79
85
{"expect greater than: GPL-2.0-or-later < GPL-2.0-only" , getLicenseNode ("GPL-2.0-or-later" , true ), getLicenseNode ("GPL-2.0-only" , false ), false },
80
86
{"expect greater than: GPL-2.0-or-later == GPL-2.0" , getLicenseNode ("GPL-2.0-or-later" , true ), getLicenseNode ("GPL-2.0" , false ), false },
87
+ {"expect equal: GPL-2.0-only < GPL-2.0" , getLicenseNode ("GPL-2.0-only" , false ), getLicenseNode ("GPL-2.0" , false ), false },
81
88
{"expect equal: GPL-3.0 < GPL-3.0" , getLicenseNode ("GPL-3.0" , false ), getLicenseNode ("GPL-3.0" , false ), false },
89
+ {"expect equal: MIT < MIT" , getLicenseNode ("MIT" , false ), getLicenseNode ("MIT" , false ), false },
82
90
{"expect less than: MPL-1.0 < MPL-2.0" , getLicenseNode ("MPL-1.0" , false ), getLicenseNode ("MPL-2.0" , false ), true },
83
91
{"incompatible: MIT < ISC" , getLicenseNode ("MIT" , false ), getLicenseNode ("ISC" , false ), false },
92
+ {"incompatible: MIT < GPL-2.0-only" , getLicenseNode ("MIT" , false ), getLicenseNode ("GPL-2.0-only" , false ), false },
84
93
{"incompatible: OSL-1.0 < OPL-1.0" , getLicenseNode ("OSL-1.0" , false ), getLicenseNode ("OPL-1.0" , false ), false },
85
94
{"not simple license: (MIT OR ISC) < GPL-3.0" , getLicenseNode ("(MIT OR ISC)" , false ), getLicenseNode ("GPL-3.0" , false ), false }, // TODO: should it raise error?
86
95
}
0 commit comments