The following commit has been merged in the master branch: commit fa98524b587fd1d8c376c00cbd51eeee75d1c197 Author: Raphaël Hertzog <hert...@debian.org> Date: Sun Apr 3 09:45:20 2011 +0200
libdpkg: add non-regression test for version number starting with non-digit And update the non-regression test for invalid characters to put the invalid character as the second character and not the first (which would be caught by the more strict non-digit check). diff --git a/lib/dpkg/test/t-version.c b/lib/dpkg/test/t-version.c index 2e52781..9975084 100644 --- a/lib/dpkg/test/t-version.c +++ b/lib/dpkg/test/t-version.c @@ -141,10 +141,13 @@ test_version_parse(void) test_fail(parseversion(&a, "a:0-0") == NULL); test_fail(parseversion(&a, "A:0-0") == NULL); + /* Test upstream version not starting with a digit */ + test_fail(parseversion(&a, "0:abc3-0") == NULL); + /* Test invalid characters in upstream version. */ - verstr = m_strdup("0:0-0"); + verstr = m_strdup("0:0a-0"); for (p = "!#@$%&/|\\<>()[]{};,_=*^'"; *p; p++) { - verstr[2] = *p; + verstr[3] = *p; test_fail(parseversion(&a, verstr) == NULL); } free(verstr); -- dpkg's main repository -- To UNSUBSCRIBE, email to debian-dpkg-cvs-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org