test configurations
This commit is contained in:
@@ -21,25 +21,25 @@ impl ToString for Dialogue {
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_dialogue_from_string() {
|
||||
assert_eq!(
|
||||
Dialogue::from("DLG h\nhello\ngoodbye".to_string()),
|
||||
Dialogue {
|
||||
id: "h".to_string(),
|
||||
contents: "hello\ngoodbye".to_string()
|
||||
}
|
||||
)
|
||||
}
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use crate::dialogue::Dialogue;
|
||||
|
||||
#[test]
|
||||
fn test_dialogue_to_string() {
|
||||
assert_eq!(
|
||||
Dialogue {
|
||||
#[test]
|
||||
fn test_dialogue_from_string() {
|
||||
assert_eq!(
|
||||
Dialogue::from("DLG h\nhello\ngoodbye".to_string()),
|
||||
Dialogue { id: "h".to_string(), contents: "hello\ngoodbye".to_string()}
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_dialogue_to_string() {
|
||||
let output = Dialogue {
|
||||
id: "y".to_string(),
|
||||
contents: "This is a bit of dialogue,\nblah blah\nblah blah".to_string()
|
||||
}
|
||||
.to_string(),
|
||||
"DLG y\nThis is a bit of dialogue,\nblah blah\nblah blah".to_string()
|
||||
);
|
||||
}.to_string();
|
||||
let expected = "DLG y\nThis is a bit of dialogue,\nblah blah\nblah blah".to_string();
|
||||
assert_eq!(output, expected);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user