catgirl-cooking/src/tests.rs

21 lines
533 B
Rust

#[cfg(test)]
mod tests {
// Note this useful idiom: importing names from outer (for mod tests) scope.
use crate::structures::*;
#[test]
fn test_tag_new() {
assert_eq!(Tag::new("test".to_string()), Tag('#', "test".to_string()));
}
#[test]
fn test_tag_from_string() {
assert_eq!(Tag::from_string("#test".to_string()), Tag('#', "test".to_string()));
}
#[test]
fn test_tag_to_string() {
assert_eq!(Tag('#', "test".to_string()).to_string(), "#test".to_string());
}
}