diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-12-13 12:26:05 +0400 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-12-13 12:26:05 +0400 |
commit | f87525c39d631f99f879c0be761af1ca39524952 (patch) | |
tree | e075de65da93d995c52a49f87b1865b4f6a781b6 /src/util/location.rs | |
parent | b417a89d6c33649bfa3e6fa1b951cd2ad9803299 (diff) | |
download | markdown-rs-f87525c39d631f99f879c0be761af1ca39524952.tar.gz markdown-rs-f87525c39d631f99f879c0be761af1ca39524952.tar.bz2 markdown-rs-f87525c39d631f99f879c0be761af1ca39524952.zip |
Add some tests for `Location`
Diffstat (limited to '')
-rw-r--r-- | src/util/location.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/util/location.rs b/src/util/location.rs index deff307..87d2ad8 100644 --- a/src/util/location.rs +++ b/src/util/location.rs @@ -196,4 +196,19 @@ mod tests { "should support some points (4)" ); } + #[test] + fn test_empty() { + let location = Location::new("".as_bytes()); + assert_eq!(location.to_point(0), Some(Point::new(1, 1, 0)), "to_point"); + assert_eq!( + location.relative_to_point(&[], 0), + None, + "relative_to_point" + ); + assert_eq!( + Location::relative_to_absolute(&[], 0), + None, + "relative_to_absolute" + ); + } } |