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..b8f3542 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_unique(self): + r = self.run_on_pkg(self.pkgbuild_no_source + "source=('pkgname.tar.xz' '${pkgname}-LICENSE::LICENSE.txt')") + self.assertEqual(r.errors, []) + self.assertEqual(r.warnings, []) + 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, [("non-unique-source-name %s", "LICENSE")]) + self.assertEqual(r.infos, []) + + def test_common_repo_part_unique(self): + r = self.run_on_pkg(self.pkgbuild_no_source + "source=('pkgname.tar.xz' 'LICENSE-pkgname.txt')") + self.assertEqual(r.errors, []) + self.assertEqual(r.warnings, []) + self.assertEqual(r.infos, []) + + def test_common_repo_part_non_unique(self): + r = self.run_on_pkg(self.pkgbuild_no_source + "source=('pkgname.tar.xz' '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(self): + r = self.run_on_pkg(self.pkgbuild_no_source + "source=('pkgname.tar.xz' 'ftp://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_case_insensitive(self): + r = self.run_on_pkg(self.pkgbuild_no_source + "source=('pkgname.tar.xz' 'ftp://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