mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
test(span): add Span::is_empty unit tests (#6706)
This commit is contained in:
parent
f99528d3c2
commit
d4a2529439
1 changed files with 12 additions and 0 deletions
|
|
@ -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));
|
||||
|
|
|
|||
Loading…
Reference in a new issue