diff --git a/crates/oxc_span/src/span/mod.rs b/crates/oxc_span/src/span/mod.rs index 8fb94109c..4d66624b0 100644 --- a/crates/oxc_span/src/span/mod.rs +++ b/crates/oxc_span/src/span/mod.rs @@ -401,6 +401,17 @@ impl<'a> CloneIn<'a> for Span { mod test { use super::Span; + #[test] + fn test_size() { + let s = Span::sized(0, 5); + assert_eq!(s.size(), 5); + assert!(!s.is_empty()); + + let s = Span::sized(5, 0); + assert_eq!(s.size(), 0); + assert!(s.is_empty()); + } + #[test] fn test_hash() { use std::hash::{DefaultHasher, Hash, Hasher}; @@ -410,6 +421,7 @@ mod test { Span::new(0, 5).hash(&mut second); assert_eq!(first.finish(), second.finish()); } + #[test] fn test_eq() { assert_eq!(Span::new(0, 0), Span::new(0, 0));