Signed-off-by: James P. Harvey <jamespharvey20@gmail.com> --- .../tests/pkgbuild/test_nonuniquesources.py | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/Namcap/tests/pkgbuild/test_nonuniquesources.py b/Namcap/tests/pkgbuild/test_nonuniquesources.py index 1c6d75c..b647051 100644 --- a/Namcap/tests/pkgbuild/test_nonuniquesources.py +++ b/Namcap/tests/pkgbuild/test_nonuniquesources.py @@ -55,4 +55,40 @@ package() { self.assertEqual(r.warnings, [("non-unique-source-name %s", "v1.2.3.tar.gz")]) self.assertEqual(r.infos, []) + def test_common_repo_non_unique(self): + r = self.run_on_pkg(self.pkgbuild_no_source + "source=('pkgname.tar.xz' 'LICENSE')") + self.assertEqual(r.errors, []) + self.assertEqual(r.warnings, []) + self.assertEqual(r.infos, []) + + def test_common_external_overridden(self): + r = self.run_on_pkg(self.pkgbuild_no_source + "source=('pkgname.tar.xz' '${pkgname}-LICENSE::vcs+protocol://www.example.com/LICENSE')") + self.assertEqual(r.errors, []) + self.assertEqual(r.warnings, []) + self.assertEqual(r.infos, []) + + def test_common_external_unique_part(self): + r = self.run_on_pkg(self.pkgbuild_no_source + "source=('pkgname.tar.xz' 'git+https://www.example.com/LICENSE-pkgname')") + self.assertEqual(r.errors, []) + self.assertEqual(r.warnings, []) + self.assertEqual(r.infos, []) + + def test_common_external_non_unique(self): + r = self.run_on_pkg(self.pkgbuild_no_source + "source=('pkgname.tar.xz' 'bzr+https://www.example.com/LICENSE')") + self.assertEqual(r.errors, []) + self.assertEqual(r.warnings, [("non-unique-source-name %s", "LICENSE")]) + self.assertEqual(r.infos, []) + + def test_common_external_non_unique_ignoring_extension(self): + r = self.run_on_pkg(self.pkgbuild_no_source + "source=('pkgname.tar.xz' 'hg+http://www.example.com/LICENSE.txt')") + self.assertEqual(r.errors, []) + self.assertEqual(r.warnings, [("non-unique-source-name %s", "LICENSE.txt")]) + self.assertEqual(r.infos, []) + + def test_common_external_non_unique_case_insensitive(self): + r = self.run_on_pkg(self.pkgbuild_no_source + "source=('pkgname.tar.xz' 'svn+http://www.example.com/LiCeNsE.tXt')") + self.assertEqual(r.errors, []) + self.assertEqual(r.warnings, [("non-unique-source-name %s", "LiCeNsE.tXt")]) + self.assertEqual(r.infos, []) + # vim: set ts=4 sw=4 noet: -- 2.21.0