Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/icon_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,3 +251,16 @@ impl Default for IconManager {
Self::new()
}
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn test_supports_themes_empty_manager() {
let manager = IconManager::new();
assert!(!manager.supports_themes("cat"));
assert!(!manager.supports_themes("parrot"));
assert!(!manager.supports_themes(""));
Comment on lines +262 to +264

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For better test failure diagnostics, it's recommended to use assert_eq! instead of assert!(!...). When an assert_eq! fails, it shows the values of the left and right sides of the comparison, which makes debugging easier. For example, if manager.supports_themes("cat") were to return true, the error message would clearly state assertion failed: (left == right)left:true, right: false``, which is more informative than a generic assertion failure.

Suggested change
assert!(!manager.supports_themes("cat"));
assert!(!manager.supports_themes("parrot"));
assert!(!manager.supports_themes(""));
assert_eq!(manager.supports_themes("cat"), false);
assert_eq!(manager.supports_themes("parrot"), false);
assert_eq!(manager.supports_themes(""), false);

}
}
Loading