From 5b911b102a9deec83ddeab3cddfe0ac129183f4c Mon Sep 17 00:00:00 2001 From: konstin Date: Wed, 31 Jul 2024 14:34:35 +0200 Subject: [PATCH] Use PEP440 style for range formatting --- src/range.rs | 2 +- tests/examples.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/range.rs b/src/range.rs index 378deb96..aca8655e 100644 --- a/src/range.rs +++ b/src/range.rs @@ -748,7 +748,7 @@ impl Display for Range { (Included(v), Unbounded) => write!(f, ">={v}")?, (Included(v), Included(b)) => { if v == b { - write!(f, "{v}")? + write!(f, "=={v}")? } else { write!(f, ">={v}, <={b}")? } diff --git a/tests/examples.rs b/tests/examples.rs index ed2677d3..10bdb379 100644 --- a/tests/examples.rs +++ b/tests/examples.rs @@ -237,13 +237,13 @@ fn confusing_with_lots_of_holes() { }; assert_eq!( &DefaultStringReporter::report(&derivation_tree), - r#"Because there is no available version for bar and foo 1 | 2 | 3 | 4 | 5 depends on bar, foo 1 | 2 | 3 | 4 | 5 is forbidden. -And because there is no version of foo in <1 | >1, <2 | >2, <3 | >3, <4 | >4, <5 | >5 and root 1 depends on foo, root 1 is forbidden."# + r#"Because there is no available version for bar and foo ==1 | ==2 | ==3 | ==4 | ==5 depends on bar, foo ==1 | ==2 | ==3 | ==4 | ==5 is forbidden. +And because there is no version of foo in <1 | >1, <2 | >2, <3 | >3, <4 | >4, <5 | >5 and root ==1 depends on foo, root ==1 is forbidden."# ); derivation_tree.collapse_no_versions(); assert_eq!( &DefaultStringReporter::report(&derivation_tree), - "Because foo depends on bar and root 1 depends on foo, root 1 is forbidden." + "Because foo depends on bar and root ==1 depends on foo, root ==1 is forbidden." ); assert_eq!( derivation_tree.packages(),