Skip to content

Commit

Permalink
feat(format): Include the build and prerelease when stringifying to m…
Browse files Browse the repository at this point in the history
…aintain consistency (#9)
  • Loading branch information
danielhuang authored Sep 21, 2022
1 parent 058ba9f commit f2b2e44
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -664,11 +664,17 @@ fn primitive(input: &str) -> IResult<&str, Option<BoundSet>, SemverParseError<&s
major,
minor,
patch,
pre_release,
build,
..
},
) => BoundSet::at_most(Predicate::Excluding(
(major.unwrap_or(0), minor.unwrap_or(0), patch.unwrap_or(0)).into(),
)),
) => BoundSet::at_most(Predicate::Excluding(Version {
major: major.unwrap_or(0),
minor: minor.unwrap_or(0),
patch: patch.unwrap_or(0),
build,
pre_release,
})),
(
LessThanEquals,
Partial {
Expand Down Expand Up @@ -1665,6 +1671,8 @@ mod tests {
caret_weird => ["^ 1.2 ^ 1", ">=1.2.0 <2.0.0-0"],
loose_eq1 => ["=0.7", ">=0.7.0 <0.8.0-0"],
loose_eq2 => ["=1", ">=1.0.0 <2.0.0-0"],
consistent => ["^1.0.1", ">=1.0.1 <2.0.0-0"],
consistent2 => [">=1.0.1 <2.0.0-0", ">=1.0.1 <2.0.0-0"],
];

/*
Expand Down

0 comments on commit f2b2e44

Please sign in to comment.