aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart-semver
diff options
context:
space:
mode:
Diffstat (limited to 'crates/mozart-semver')
-rw-r--r--crates/mozart-semver/src/lib.rs34
1 files changed, 0 insertions, 34 deletions
diff --git a/crates/mozart-semver/src/lib.rs b/crates/mozart-semver/src/lib.rs
index d5d2826..bad1690 100644
--- a/crates/mozart-semver/src/lib.rs
+++ b/crates/mozart-semver/src/lib.rs
@@ -336,10 +336,6 @@ fn normalize_pre_release(s: &str) -> String {
}
}
-// ─────────────────────────────────────────────────────────────────────────────
-// Constraint types
-// ─────────────────────────────────────────────────────────────────────────────
-
/// A single atomic constraint.
#[derive(Debug, Clone)]
pub enum Constraint {
@@ -436,10 +432,6 @@ impl VersionConstraint {
}
}
-// ─────────────────────────────────────────────────────────────────────────────
-// Constraint intersection helpers
-// ─────────────────────────────────────────────────────────────────────────────
-
/// A reduced range form of a constraint branch: a half-open interval with an
/// optional excluded version (from `!=`). `lower`/`upper` are `(version,
/// inclusive)`; `None` means unbounded on that side.
@@ -966,8 +958,6 @@ fn hyphen_upper_bound(raw: &str) -> Result<VersionConstraint, String> {
mod tests {
use super::*;
- // ──────────── Version parsing ────────────
-
#[test]
fn test_parse_simple() {
let v = Version::parse("1.2.3").unwrap();
@@ -1094,8 +1084,6 @@ mod tests {
assert!(!c.matches(&other));
}
- // ──────────── Version ordering ────────────
-
#[test]
fn test_ordering_major() {
let a = Version::parse("2.0.0").unwrap();
@@ -1145,8 +1133,6 @@ mod tests {
assert!(beta2 > beta1);
}
- // ──────────── Constraint parsing ────────────
-
#[test]
fn test_parse_any() {
let c = VersionConstraint::parse("*").unwrap();
@@ -1254,8 +1240,6 @@ mod tests {
assert!(!c.matches(&Version::parse("2.1.0").unwrap()));
}
- // ──────────── Helper ────────────
-
fn satisfies(constraint: &str, version: &str) -> bool {
let c = VersionConstraint::parse(constraint).unwrap();
let v = Version::parse(version).unwrap();
@@ -1624,8 +1608,6 @@ mod tests {
// 3. CONSTRAINT PARSING EDGE CASES
// ══════════════════════════════════════════════════════════════════════════
- // ── Caret ──
-
#[test]
fn test_caret_zero_zero_three() {
// ^0.0.3 → >=0.0.3 <0.0.4
@@ -1673,8 +1655,6 @@ mod tests {
assert!(!satisfies("^1.2.3", "2.0.0"));
}
- // ── Tilde ──
-
#[test]
fn test_tilde_single_major() {
// ~1 → >=1.0.0 <2.0.0
@@ -1707,8 +1687,6 @@ mod tests {
assert!(!satisfies("~1.2.3", "1.3.0"));
}
- // ── Wildcard ──
-
#[test]
fn test_wildcard_major_only() {
// 1.* → >=1.0.0 <2.0.0
@@ -1752,8 +1730,6 @@ mod tests {
let _ = VersionConstraint::parse("v1.*"); // just verify it doesn't panic
}
- // ── Hyphen ranges ──
-
#[test]
fn test_hyphen_range_partial_from() {
// "1.0 - 2.0": 1.0 is a partial "from", lower = >=1.0.0
@@ -1787,8 +1763,6 @@ mod tests {
assert!(!satisfies("1.0.0-alpha1 - 1.0.0-RC1", "1.0.0"));
}
- // ── Comparison operators ──
-
#[test]
fn test_gt_boundary() {
assert!(!satisfies(">1.0.0", "1.0.0"));
@@ -1834,8 +1808,6 @@ mod tests {
assert!(satisfies(">=1.0.0", "1.0.0"));
}
- // ── AND constraints ──
-
#[test]
fn test_and_comma_separated() {
// Comma-separated constraints act as AND
@@ -1867,8 +1839,6 @@ mod tests {
assert!(!satisfies(">=1.2.3 <=1.2.3", "1.2.2"));
}
- // ── OR constraints ──
-
#[test]
fn test_or_double_pipe() {
assert!(satisfies("^1.0 || ^2.0", "1.5.0"));
@@ -1909,8 +1879,6 @@ mod tests {
assert!(!satisfies("1.0.0 || 2.0.0 || 3.0.0", "1.0.1"));
}
- // ── Complex combined ──
-
#[test]
fn test_combined_and_within_or() {
// ">=1.0 <2.0 || >=3.0 <4.0"
@@ -1950,8 +1918,6 @@ mod tests {
assert!(!satisfies(">=5.4 <7.0", "7.0.0"));
}
- // ── Edge cases ──
-
#[test]
fn test_constraint_empty_string_is_any() {
// Empty string → Any constraint