Skip to content

Commit f87525c

Browse files
committed
Add some tests for Location
1 parent b417a89 commit f87525c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/util/location.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,4 +196,19 @@ mod tests {
196196
"should support some points (4)"
197197
);
198198
}
199+
#[test]
200+
fn test_empty() {
201+
let location = Location::new("".as_bytes());
202+
assert_eq!(location.to_point(0), Some(Point::new(1, 1, 0)), "to_point");
203+
assert_eq!(
204+
location.relative_to_point(&[], 0),
205+
None,
206+
"relative_to_point"
207+
);
208+
assert_eq!(
209+
Location::relative_to_absolute(&[], 0),
210+
None,
211+
"relative_to_absolute"
212+
);
213+
}
199214
}

0 commit comments

Comments
 (0)