forked from gentoo-utils/gentoo-utils
support "=" version operator
This commit is contained in:
@@ -15,6 +15,7 @@ pub enum Blocker {
|
||||
pub enum VersionOperator {
|
||||
Lt,
|
||||
Gt,
|
||||
Eq,
|
||||
LtEq,
|
||||
GtEq,
|
||||
Roughly,
|
||||
|
||||
@@ -23,6 +23,7 @@ pub fn version_operator<'a>() -> impl Parser<&'a str, Output = VersionOperator>
|
||||
.or(tag(">=").map(|_| VersionOperator::GtEq))
|
||||
.or(tag("<").map(|_| VersionOperator::Lt))
|
||||
.or(tag(">").map(|_| VersionOperator::Gt))
|
||||
.or(tag("=").map(|_| VersionOperator::Eq))
|
||||
.or(tag("~").map(|_| VersionOperator::Roughly))
|
||||
}
|
||||
|
||||
@@ -315,4 +316,11 @@ mod test {
|
||||
|
||||
assert!(atom().check_finished(it).is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_atom_with_eq_version_operator() {
|
||||
let it = InputIter::new("=foo/bar-1.0.0");
|
||||
|
||||
atom().check_finished(it).unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user