Skip to content

Commit

Permalink
token test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Lurk committed Sep 26, 2024
1 parent 84f79e5 commit 834fe16
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/lexer/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
);
}
}

0 comments on commit 834fe16

Please sign in to comment.