aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-07 13:46:50 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-07 13:46:50 +0000
commita47dcf581e0dcff0ec9d2b5a56e0af25f4303d2a (patch)
tree5829c4a642b236ab8d103b99baca8f9717eb485b
parent8265987fc10672678dc7d5c3b224e793d5a6bd68 (diff)
downloadpaludis-a47dcf581e0dcff0ec9d2b5a56e0af25f4303d2a.tar.gz
paludis-a47dcf581e0dcff0ec9d2b5a56e0af25f4303d2a.tar.xz
Extend portage repository test coverage
-rw-r--r--paludis/portage_repository_TEST.cc28
-rwxr-xr-xpaludis/portage_repository_TEST_setup.sh19
2 files changed, 47 insertions, 0 deletions
diff --git a/paludis/portage_repository_TEST.cc b/paludis/portage_repository_TEST.cc
index f8fa896..48c6af6 100644
--- a/paludis/portage_repository_TEST.cc
+++ b/paludis/portage_repository_TEST.cc
@@ -259,5 +259,33 @@ namespace test_cases
}
} test_portage_repository_package_names;
+ struct PortageRepositoryBadPackageNamesTest : TestCase
+ {
+ PortageRepositoryBadPackageNamesTest() : TestCase("bad package names") { }
+
+ void run()
+ {
+ TestEnvironment env;
+ std::map<std::string, std::string> keys;
+ keys.insert(std::make_pair("format", "portage"));
+ keys.insert(std::make_pair("location", "portage_repository_TEST_dir/repo5"));
+ keys.insert(std::make_pair("profile", "portage_repository_TEST_dir/repo5/profiles/profile"));
+ PortageRepository::Pointer repo(PortageRepository::make_portage_repository(
+ &env, env.package_database().raw_pointer(), keys));
+
+ QualifiedPackageNameCollection::ConstPointer names(0);
+
+ for (int pass = 1 ; pass <= 2 ; ++pass)
+ {
+ TestMessageSuffix pass_suffix(stringify(pass), true);
+
+ names = repo->package_names(CategoryNamePart("cat-one"));
+ TEST_CHECK(! names->empty());
+ TEST_CHECK(names->end() != names->find(QualifiedPackageName("cat-one/pkg-one")));
+ TEST_CHECK_EQUAL(1, std::distance(names->begin(), names->end()));
+ }
+ }
+ } test_portage_repository_bad_package_names;
+
}
diff --git a/paludis/portage_repository_TEST_setup.sh b/paludis/portage_repository_TEST_setup.sh
index eccb9b5..520b07a 100755
--- a/paludis/portage_repository_TEST_setup.sh
+++ b/paludis/portage_repository_TEST_setup.sh
@@ -60,3 +60,22 @@ END
cd ..
+mkdir -p repo5/{eclass,distfiles,profiles/profile} || exit 1
+mkdir -p repo5/cat-one/{pkg-one,pkg-1,pkg.one} || exit 1
+cd repo5 || exit 1
+echo "test-repo-5" > profiles/repo_name || exit 1
+cat <<END > profiles/categories || exit 1
+cat-one
+END
+cat <<END > profiles/profile/make.defaults
+ARCH=test
+END
+cat <<END > cat-one/pkg-one/pkg-one-1.ebuild || exit 1
+END
+cat <<END > cat-one/pkg-1/pkg-1-1.ebuild || exit 1
+END
+cat <<END > cat-one/pkg.one/pkg.one-1.ebuild || exit 1
+END
+cd ..
+
+