diff options
-rw-r--r-- | src/unist.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/unist.rs b/src/unist.rs index 75ef359..ce2de65 100644 --- a/src/unist.rs +++ b/src/unist.rs @@ -73,3 +73,26 @@ impl fmt::Debug for Position { ) } } + +#[cfg(test)] +mod tests { + use super::*; + use alloc::format; + + #[test] + fn unist_test() { + let point = Point::new(1, 1, 0); + assert_eq!( + format!("{:?}", point), + "1:1 (0)", + "should support `Debug` on unist points" + ); + + let position = Position::new(1, 1, 0, 1, 3, 2); + assert_eq!( + format!("{:?}", position), + "1:1-1:3 (0-2)", + "should support `Debug` on unist positions" + ); + } +} |