diff --git a/opening-hours-syntax/src/tests/rubik.rs b/opening-hours-syntax/src/tests/rubik.rs index 8a4a8c1c..517c2824 100644 --- a/opening-hours-syntax/src/tests/rubik.rs +++ b/opening-hours-syntax/src/tests/rubik.rs @@ -70,6 +70,7 @@ fn test_pop_disjoint() { // 5 ⋅ A ⋅ ⋅ B B B ⋅ // 6 ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ let mut grid = grid_empty.clone(); + grid.set( &EmptyPavingSelector.dim([1..2, 4..7]).dim_front([3..6]), true, @@ -83,3 +84,21 @@ fn test_pop_disjoint() { assert_eq!(grid, grid_empty); assert_eq!(grid.pop_selector(true), None); } + +#[test] +fn test_debug() { + // 0 1 2 3 4 5 6 7 + // 2 ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ + // 3 ⋅ A ⋅ ⋅ B B B ⋅ + // 4 ⋅ A ⋅ ⋅ B B B ⋅ + // 5 ⋅ A ⋅ ⋅ B B B ⋅ + // 6 ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ + let mut grid = Paving2D::default(); + + grid.set( + &EmptyPavingSelector.dim([1..2, 4..7]).dim_front([3..6]), + true, + ); + + assert_eq!(&format!("{grid:?}"), "Dim { [3, 6[: Dim { [1, 2[: Cell { inner: true }, [2, 4[: Cell { inner: false }, [4, 7[: Cell { inner: true } } }") +} diff --git a/opening-hours/src/utils/range.rs b/opening-hours/src/utils/range.rs index 3708fc1e..770c36d3 100644 --- a/opening-hours/src/utils/range.rs +++ b/opening-hours/src/utils/range.rs @@ -24,22 +24,6 @@ impl DateTimeRange { ) -> Self { Self { range, kind, comments } } - - pub fn map_dates(self, mut map: impl FnMut(D) -> D2) -> DateTimeRange { - DateTimeRange { - range: map(self.range.start)..map(self.range.end), - kind: self.kind, - comments: self.comments, - } - } - - pub fn comments(&self) -> &[Arc] { - &self.comments - } - - pub fn into_comments(self) -> UniqueSortedVec> { - self.comments - } } // WrappingRange