aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-03 19:29:16 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-03 19:29:16 +0000
commit795c9e6614d175b91a129bba265cc8da7d44352d (patch)
tree5c6d833f1124f4d8895521cff80d1c886894bb81
parentc51b661f8724964c539eaf6de0ac0fe9655dc99c (diff)
downloadpaludis-795c9e6614d175b91a129bba265cc8da7d44352d.tar.gz
paludis-795c9e6614d175b91a129bba265cc8da7d44352d.tar.xz
Display :slot deps correctly
-rw-r--r--paludis/dep_atom.cc2
-rw-r--r--paludis/dep_parser_TEST.cc20
2 files changed, 17 insertions, 5 deletions
diff --git a/paludis/dep_atom.cc b/paludis/dep_atom.cc
index 4ea3fc6..e07d9fa 100644
--- a/paludis/dep_atom.cc
+++ b/paludis/dep_atom.cc
@@ -175,7 +175,7 @@ paludis::operator<< (std::ostream & s, const PackageDepAtom & a)
}
if (a.slot_ptr())
- s << *a.slot_ptr();
+ s << ":" << *a.slot_ptr();
return s;
}
diff --git a/paludis/dep_parser_TEST.cc b/paludis/dep_parser_TEST.cc
index 082e703..0946b8d 100644
--- a/paludis/dep_parser_TEST.cc
+++ b/paludis/dep_parser_TEST.cc
@@ -98,10 +98,22 @@ namespace test_cases
void run()
{
- std::stringstream s;
- DepAtomDumper d(&s);
- DepParser::parse(">=app-editors/vim-6.4_alpha")->accept(&d);
- TEST_CHECK_EQUAL(s.str(), "<all><package version=\">=6.4_alpha\">"
+ std::stringstream s1;
+ DepAtomDumper d1(&s1);
+ DepParser::parse(">=app-editors/vim-6.4_alpha")->accept(&d1);
+ TEST_CHECK_EQUAL(s1.str(), "<all><package version=\">=6.4_alpha\">"
+ "app-editors/vim</package></all>");
+
+ std::stringstream s2;
+ DepAtomDumper d2(&s2);
+ DepParser::parse("=app-editors/vim-6.4_alpha-r1")->accept(&d2);
+ TEST_CHECK_EQUAL(s2.str(), "<all><package version=\"=6.4_alpha-r1\">"
+ "app-editors/vim</package></all>");
+
+ std::stringstream s3;
+ DepAtomDumper d3(&s3);
+ DepParser::parse(">=app-editors/vim-6.4_alpha:one")->accept(&d3);
+ TEST_CHECK_EQUAL(s3.str(), "<all><package slot=\"one\" version=\">=6.4_alpha\">"
"app-editors/vim</package></all>");
}
} test_dep_atom_parser_decorated_package;