From 834fe16aa19942580ad782e640df41ceb2c1a35e Mon Sep 17 00:00:00 2001 From: Lurk Date: Thu, 26 Sep 2024 22:11:36 +0200 Subject: [PATCH] token test coverage --- src/lexer/token.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/lexer/token.rs b/src/lexer/token.rs index 25e7dd7..aedf086 100644 --- a/src/lexer/token.rs +++ b/src/lexer/token.rs @@ -77,3 +77,18 @@ impl Display for Token<'_> { f.write_str(self.slice) } } + +#[cfg(test)] +mod tests { + use pretty_assertions::assert_eq; + + use crate::lexer::{Position, Token, TokenKind}; + + #[test] + fn display() { + assert_eq!( + Token::new(TokenKind::Literal, "str", Position::default()).to_string(), + "str" + ); + } +}