Expand test coverage

This commit is contained in:
Juno Takano 2026-01-10 05:42:36 -03:00
commit 5958f1551b
27 changed files with 593 additions and 109 deletions

View file

@ -44,6 +44,8 @@ impl std::fmt::Display for CheckBox {
#[cfg(test)]
mod tests {
use crate::syntax::content::parser::token::Token;
use super::*;
#[test]
@ -54,4 +56,19 @@ mod tests {
let code_closed = CheckBox::new(false);
assert_eq!(code_closed.render(), r#"<input type="checkbox"/>"#);
}
#[test]
fn token_display() {
let mut checkbox = CheckBox::new(true);
assert_eq!(
format!("{}", Token::CheckBox(checkbox.clone())),
"Tk:CheckBox [checked]"
);
checkbox.checked = false;
assert_eq!(
format!("{}", Token::CheckBox(checkbox.clone())),
"Tk:CheckBox [empty]"
);
}
}