1#!perl 2use strict; 3use warnings; 4use Test::More tests => 25; 5 6# spdx names can be found: https://github.com/OpenSourceOrg/licenses/blob/master/licenses/spdx/spdx.json 7 8use Software::License::AGPL_3; 9use Software::License::Apache_1_1; 10use Software::License::Apache_2_0; 11use Software::License::Artistic_1_0; 12use Software::License::Artistic_2_0; 13use Software::License::BSD; 14use Software::License::CC0_1_0; 15use Software::License::EUPL_1_1; 16use Software::License::EUPL_1_2; 17use Software::License::FreeBSD; 18use Software::License::GFDL_1_2; 19use Software::License::GFDL_1_3; 20use Software::License::GPL_1; 21use Software::License::GPL_2; 22use Software::License::GPL_3; 23use Software::License::LGPL_2_1; 24use Software::License::LGPL_3_0; 25use Software::License::MIT; 26use Software::License::Mozilla_1_0; 27use Software::License::Mozilla_1_1; 28use Software::License::Mozilla_2_0; 29use Software::License::OpenSSL; 30use Software::License::PostgreSQL; 31use Software::License::QPL_1_0; 32use Software::License::Zlib; 33 34is (scalar(Software::License::AGPL_3->spdx_expression()), 35 'AGPL-3.0', 36 "AGPL_3->spdx_expression() is OK." 37); 38 39is (scalar(Software::License::Apache_1_1->spdx_expression()), 40 'Apache-1.1', 41 "Apache_1_1->spdx_expression() is OK." 42); 43 44is (scalar(Software::License::Apache_2_0->spdx_expression()), 45 'Apache-2.0', 46 "Apache_2_0->spdx_expression() is OK." 47); 48 49is (scalar(Software::License::Artistic_1_0->spdx_expression()), 50 'Artistic-1.0', 51 "Artistic_1_0->spdx_expression() is OK." 52); 53 54is (scalar(Software::License::Artistic_2_0->spdx_expression()), 55 'Artistic-2.0', 56 "Artistic_2_0->spdx_expression() is OK." 57); 58 59is (scalar(Software::License::BSD->spdx_expression()), 60 'BSD', 61 "BSD->spdx_expression() is OK." 62); 63 64is (scalar(Software::License::CC0_1_0->spdx_expression()), 65 'CC0-1.0', 66 "CC0_1_0->spdx_expression() is OK." 67); 68 69is (scalar(Software::License::EUPL_1_1->spdx_expression()), 70 'EUPL-1.1', 71 "EUPL_1_1->spdx_expression() is OK." 72); 73 74is (scalar(Software::License::EUPL_1_2->spdx_expression()), 75 'EUPL-1.2', 76 "EUPL_1_2->spdx_expression() is OK." 77); 78 79is (scalar(Software::License::FreeBSD->spdx_expression()), 80 'BSD-2-Clause-FreeBSD', 81 "FreeBSD->spdx_expression() is OK." 82); 83 84is (scalar(Software::License::GFDL_1_2->spdx_expression()), 85 'GFDL-1.2-or-later', 86 "GFDL-1_2->spdx_expression() is OK." 87); 88 89is (scalar(Software::License::GFDL_1_3->spdx_expression()), 90 'GFDL-1.3-or-later', 91 "GFDL_1_3->spdx_expression() is OK." 92); 93 94is (scalar(Software::License::GPL_1->spdx_expression()), 95 'GPL-1.0-only', 96 "GPL_1->spdx_expression() is OK." 97); 98 99is (scalar(Software::License::GPL_2->spdx_expression()), 100 'GPL-2.0-only', 101 "GPL_2->spdx_expression() is OK." 102); 103 104is (scalar(Software::License::GPL_3->spdx_expression()), 105 'GPL-3.0-only', 106 "GPL_3->spdx_expression() is OK." 107); 108 109is (scalar(Software::License::LGPL_2_1->spdx_expression()), 110 'LGPL-2.1', 111 "LGPL_2_1->spdx_expression() is OK." 112); 113 114is (scalar(Software::License::LGPL_3_0->spdx_expression()), 115 'LGPL-3.0', 116 "LGPL_3_0->spdx_expression() is OK." 117); 118 119is (scalar(Software::License::MIT->spdx_expression()), 120 'MIT', 121 "MIT->spdx_expression() is OK." 122); 123 124is (scalar(Software::License::Mozilla_1_0->spdx_expression()), 125 'MPL-1.0', 126 "Mozilla_1_0->spdx_expression() is OK." 127); 128 129is (scalar(Software::License::Mozilla_1_1->spdx_expression()), 130 'MPL-1.1', 131 "Mozilla_1_1->spdx_expression() is OK." 132); 133 134is (scalar(Software::License::Mozilla_2_0->spdx_expression()), 135 'MPL-2.0', 136 "Mozilla_2_0->spdx_expression() is OK." 137); 138 139is (scalar(Software::License::OpenSSL->spdx_expression()), 140 'OpenSSL', 141 "OpenSSL->spdx_expression() is OK." 142); 143 144is (scalar(Software::License::PostgreSQL->spdx_expression()), 145 'PostgreSQL', 146 "PostgreSQL->spdx_expression() is OK." 147); 148 149is (scalar(Software::License::QPL_1_0->spdx_expression()), 150 'QPL-1.0', 151 "QPL_1_0->spdx_expression() is OK." 152); 153 154is (scalar(Software::License::Zlib->spdx_expression()), 155 'Zlib', 156 "Zlib->spdx_expression() is OK." 157); 158 159