#[test]
fn lex_datum_labels() {
let source = r"#0=(#0# 2 3)";
let data = [
(Token::DatumLabeler("0".to_string()), (0..3), "#0="),
(Token::LParen, (3..4), "("),
(Token::DatumLabel("0".to_string()), (4..7), "#0#"),
(Token::Integer((2, 0)), (8..9), "2"),
(Token::Integer((3, 0)), (10..11), "3"),
(Token::RParen, (11..12), ")"),
];
let lexer = Token::lexer(source);
for ((tok, span), (lexed, tspan, tslice)) in lexer
.spanned()
.filter(|(tok, _)| tok.is_err() || tok.as_ref().is_ok_and(|v| v != &Token::Whitespace))
.zip(data.into_iter())
{
let slice = &source[span.clone()];
assert!(tok == Ok(lexed));
assert!(span == tspan);
assert!(slice == tslice);
}
}