summaryrefslogtreecommitdiff
path: root/src/atom/parsers.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/atom/parsers.rs')
-rw-r--r--src/atom/parsers.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/atom/parsers.rs b/src/atom/parsers.rs
index 4806857..37e18a7 100644
--- a/src/atom/parsers.rs
+++ b/src/atom/parsers.rs
@@ -351,10 +351,12 @@ impl<'a> Parseable<'a, &'a str> for Cpv {
Category::parser()
.and(Name::parser().preceded_by(tag("/")))
.and(Version::parser().preceded_by(tag("-")))
- .map(|((category, name), version)| Cpv {
+ .and(Slot::parser().preceded_by(tag(":")).opt())
+ .map(|(((category, name), version), slot)| Cpv {
category,
name,
version,
+ slot,
})
}
}
@@ -479,4 +481,11 @@ mod test {
Atom::parser().check_finished(it).unwrap();
}
+
+ #[test]
+ fn test_cpv_with_slot() {
+ let it = InputIter::new("foo/bar-1.0:slot/sub=");
+
+ Cpv::parser().check_finished(it).unwrap();
+ }
}