Add tests for the content syntax parser
This commit is contained in:
parent
4ae966e503
commit
e50bbd468d
12 changed files with 383 additions and 120 deletions
|
|
@ -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("", ""));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue