@@ -20,9 +20,12 @@ func TestCompareGT(t *testing.T) {
2020		{"expect greater than: AGPL-3.0 > AGPL-1.0" , getLicenseNode ("AGPL-3.0" , false ), getLicenseNode ("AGPL-1.0" , false ), true },
2121		{"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 },
2222		{"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 },
2324		{"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 },
2426		{"expect less than: MPL-1.0 > MPL-2.0" , getLicenseNode ("MPL-1.0" , false ), getLicenseNode ("MPL-2.0" , false ), false },
2527		{"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 },
2629		{"incompatible: OSL-1.0 > OPL-1.0" , getLicenseNode ("OSL-1.0" , false ), getLicenseNode ("OPL-1.0" , false ), false },
2730		{"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? 
2831	}
@@ -49,9 +52,12 @@ func TestCompareEQ(t *testing.T) {
4952		{"expect greater than: AGPL-3.0 == AGPL-1.0" , getLicenseNode ("AGPL-3.0" , false ), getLicenseNode ("AGPL-1.0" , false ), false },
5053		{"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 },
5154		{"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 },
5256		{"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 },
5358		{"expect less than: MPL-1.0 == MPL-2.0" , getLicenseNode ("MPL-1.0" , false ), getLicenseNode ("MPL-2.0" , false ), false },
5459		{"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 },
5561		{"incompatible: OSL-1.0 == OPL-1.0" , getLicenseNode ("OSL-1.0" , false ), getLicenseNode ("OPL-1.0" , false ), false },
5662		{"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? 
5763	}
@@ -78,9 +84,12 @@ func TestCompareLT(t *testing.T) {
7884		{"expect greater than: AGPL-3.0 < AGPL-1.0" , getLicenseNode ("AGPL-3.0" , false ), getLicenseNode ("AGPL-1.0" , false ), false },
7985		{"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 },
8086		{"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 },
8188		{"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 },
8290		{"expect less than: MPL-1.0 < MPL-2.0" , getLicenseNode ("MPL-1.0" , false ), getLicenseNode ("MPL-2.0" , false ), true },
8391		{"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 },
8493		{"incompatible: OSL-1.0 < OPL-1.0" , getLicenseNode ("OSL-1.0" , false ), getLicenseNode ("OPL-1.0" , false ), false },
8594		{"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? 
8695	}
0 commit comments