test configurations

This commit is contained in:
2020-04-19 08:13:55 +01:00
parent d0614b6de2
commit 76e6c2477c
15 changed files with 515 additions and 451 deletions

View File

@@ -30,25 +30,29 @@ impl ToString for Ending {
}
}
#[test]
fn test_ending_from_string() {
assert_eq!(
Ending::from(include_str!("test-resources/ending").to_string()),
Ending {
id: "a".to_string(),
dialogue: "This is a long line of dialogue. Blah blah blah".to_string()
}
);
}
#[cfg(test)]
mod test {
use crate::ending::Ending;
#[test]
fn test_ending_to_string() {
assert_eq!(
Ending {
id: "7".to_string(),
dialogue: "This is another long ending. So long, farewell, etc.".to_string()
}
.to_string(),
"END 7\nThis is another long ending. So long, farewell, etc.".to_string()
);
#[test]
fn test_ending_from_string() {
assert_eq!(
Ending::from(include_str!("test-resources/ending").to_string()),
Ending {
id: "a".to_string(),
dialogue: "This is a long line of dialogue. Blah blah blah".to_string()
}
);
}
#[test]
fn test_ending_to_string() {
assert_eq!(
Ending {
id: "7".to_string(),
dialogue: "This is another long ending. So long, farewell, etc.".to_string()
}.to_string(),
"END 7\nThis is another long ending. So long, farewell, etc.".to_string()
);
}
}