Add tests for the content syntax parser

This commit is contained in:
Juno Takano 2025-12-26 04:19:21 -03:00
commit e50bbd468d
12 changed files with 383 additions and 120 deletions

View file

@ -30,3 +30,25 @@ impl Parseable for Code {
}
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn render() {
let code_open = Code::new(true);
assert_eq!(code_open.render(), "<code>");
let code_closed = Code::new(false);
assert_eq!(code_closed.render(), "</code>");
}
#[test]
#[should_panic(
expected = "Attempt to lex a code tag directly from a lexeme"
)]
fn lex() {
Code::lex(&Lexeme::new("", ""));
}
}