Expand test coverage
This commit is contained in:
parent
3837af387a
commit
5958f1551b
27 changed files with 593 additions and 109 deletions
|
|
@ -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]"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue