Skip to content

Commit

Permalink
used assert macro with a literal bool
Browse files Browse the repository at this point in the history
  • Loading branch information
binlingyu committed May 23, 2024
1 parent 94b922d commit be8ca56
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
9 changes: 3 additions & 6 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1331,7 +1331,7 @@ mod tests {
smart-punctuation = true
"#;
let config = Config::from_str(src).unwrap();
assert_eq!(config.html_config().unwrap().smart_punctuation(), true);
assert!(config.html_config().unwrap().smart_punctuation());

let src = r#"
[book]
Expand All @@ -1341,16 +1341,13 @@ mod tests {
curly-quotes = true
"#;
let config = Config::from_str(src).unwrap();
assert_eq!(config.html_config().unwrap().smart_punctuation(), true);
assert!(config.html_config().unwrap().smart_punctuation());

let src = r#"
[book]
title = "mdBook Documentation"
"#;
let config = Config::from_str(src).unwrap();
assert_eq!(
config.html_config().unwrap_or_default().smart_punctuation(),
false
);
assert!(!config.html_config().unwrap_or_default().smart_punctuation());
}
}
4 changes: 2 additions & 2 deletions tests/custom_preprocessors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fn example_supports_whatever() {

let got = cmd.supports_renderer("whatever");

assert_eq!(got, true);
assert!(got);
}

#[test]
Expand All @@ -26,7 +26,7 @@ fn example_doesnt_support_not_supported() {

let got = cmd.supports_renderer("not-supported");

assert_eq!(got, false);
assert!(!got);
}

#[test]
Expand Down

0 comments on commit be8ca56

Please sign in to comment.