From e3c8b1c5273e20a6c20b5ba923cdcea919340950 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 21 May 2018 17:25:00 +0300 Subject: Add validate_package_name() function, validate manifest package names --- tests/manifest/testscript | 79 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) (limited to 'tests/manifest') diff --git a/tests/manifest/testscript b/tests/manifest/testscript index 15a20ab..c8fdfaa 100644 --- a/tests/manifest/testscript +++ b/tests/manifest/testscript @@ -5,6 +5,85 @@ : packages : { + : name + : + { + : valid + : + $* -pp <>EOF + : 1 + sha256sum: a2b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + : + name: libfoo.c++-2 + version: 2.0.0 + summary: Modern C++ parser + license: LGPLv2 + url: http://www.example.org/projects/libfoo/ + email: libfoo-users@example.org + location: libfoo.c++-2-2.0.0.tar.bz2 + sha256sum: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + EOF + + : invalid + : + { + : short + : + $* -pp <'stdin:4:7: error: invalid package name: length is less than two characters' != 0 + : 1 + sha256sum: a2b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + : + name: b + EOI + + : illegal + : + $* -pp <'stdin:4:7: error: invalid package name: illegal name' != 0 + : 1 + sha256sum: a2b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + : + name: com3 + EOI + + : first-char + : + $* -pp <'stdin:4:7: error: invalid package name: illegal first character (must be alphabetic)' != 0 + : 1 + sha256sum: a2b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + : + name: 2b + EOI + + : last-char + : + $* -pp <'stdin:4:7: error: invalid package name: illegal last character (must be alphabetic or digit)' != 0 + : 1 + sha256sum: a2b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + : + name: foo_ + EOI + + : char + : + $* -pp <'stdin:4:7: error: invalid package name: illegal character' != 0 + : 1 + sha256sum: a2b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + : + name: foo'bar + EOI + + : dependency + : + $* -pp <'stdin:5:10: error: invalid prerequisite package name: length is less than two characters' != 0 + : 1 + sha256sum: a2b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + : + name: foo + depends: b + EOI + } + } + : pkg : { -- cgit v1.1