diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2018-05-21 17:25:00 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2018-05-21 18:30:18 +0300 |
commit | e3c8b1c5273e20a6c20b5ba923cdcea919340950 (patch) | |
tree | b1ac64796daed928aba3eca6e65165960a1e940b /tests/manifest/testscript | |
parent | 716a34125008cb5ad16b32b0032822b7e27d0225 (diff) |
Add validate_package_name() function, validate manifest package names
Diffstat (limited to 'tests/manifest/testscript')
-rw-r--r-- | tests/manifest/testscript | 79 |
1 files changed, 79 insertions, 0 deletions
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 >>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 <<EOI 2>'stdin:4:7: error: invalid package name: length is less than two characters' != 0 + : 1 + sha256sum: a2b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + : + name: b + EOI + + : illegal + : + $* -pp <<EOI 2>'stdin:4:7: error: invalid package name: illegal name' != 0 + : 1 + sha256sum: a2b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + : + name: com3 + EOI + + : first-char + : + $* -pp <<EOI 2>'stdin:4:7: error: invalid package name: illegal first character (must be alphabetic)' != 0 + : 1 + sha256sum: a2b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + : + name: 2b + EOI + + : last-char + : + $* -pp <<EOI 2>'stdin:4:7: error: invalid package name: illegal last character (must be alphabetic or digit)' != 0 + : 1 + sha256sum: a2b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + : + name: foo_ + EOI + + : char + : + $* -pp <<EOI 2>'stdin:4:7: error: invalid package name: illegal character' != 0 + : 1 + sha256sum: a2b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + : + name: foo'bar + EOI + + : dependency + : + $* -pp <<EOI 2>'stdin:5:10: error: invalid prerequisite package name: length is less than two characters' != 0 + : 1 + sha256sum: a2b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + : + name: foo + depends: b + EOI + } + } + : pkg : { |