test configurations
This commit is contained in:
96
src/exit.rs
96
src/exit.rs
@@ -87,52 +87,58 @@ impl ToString for Exit {
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_exit_from_string() {
|
||||
assert_eq!(
|
||||
Exit::from("a 12,13".to_string()),
|
||||
Exit {
|
||||
room_id: 10,
|
||||
position: Position { x: 12, y: 13 },
|
||||
effect: Transition::None
|
||||
}
|
||||
);
|
||||
}
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use crate::exit::{Transition, Exit};
|
||||
use crate::position::Position;
|
||||
|
||||
#[test]
|
||||
fn test_exit_from_string_with_fx() {
|
||||
assert_eq!(
|
||||
Exit::from("a 12,13 FX slide_u".to_string()),
|
||||
Exit {
|
||||
room_id: 10,
|
||||
position: Position { x: 12, y: 13 },
|
||||
effect: Transition::SlideUp
|
||||
}
|
||||
);
|
||||
}
|
||||
#[test]
|
||||
fn test_exit_from_string() {
|
||||
assert_eq!(
|
||||
Exit::from("a 12,13".to_string()),
|
||||
Exit {
|
||||
room_id: 10,
|
||||
position: Position { x: 12, y: 13 },
|
||||
effect: Transition::None
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_exit_to_string() {
|
||||
assert_eq!(
|
||||
Exit {
|
||||
room_id: 8,
|
||||
position: Position { x: 5, y: 6 },
|
||||
effect: Transition::None
|
||||
}
|
||||
.to_string(),
|
||||
"8 5,6".to_string()
|
||||
);
|
||||
}
|
||||
#[test]
|
||||
fn test_exit_from_string_with_fx() {
|
||||
assert_eq!(
|
||||
Exit::from("a 12,13 FX slide_u".to_string()),
|
||||
Exit {
|
||||
room_id: 10,
|
||||
position: Position { x: 12, y: 13 },
|
||||
effect: Transition::SlideUp
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_exit_to_string_with_fx() {
|
||||
assert_eq!(
|
||||
Exit {
|
||||
room_id: 8,
|
||||
position: Position { x: 5, y: 6 },
|
||||
effect: Transition::FadeToWhite
|
||||
}
|
||||
.to_string(),
|
||||
"8 5,6 FX fade_w".to_string()
|
||||
);
|
||||
#[test]
|
||||
fn test_exit_to_string() {
|
||||
assert_eq!(
|
||||
Exit {
|
||||
room_id: 8,
|
||||
position: Position { x: 5, y: 6 },
|
||||
effect: Transition::None
|
||||
}
|
||||
.to_string(),
|
||||
"8 5,6".to_string()
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_exit_to_string_with_fx() {
|
||||
assert_eq!(
|
||||
Exit {
|
||||
room_id: 8,
|
||||
position: Position { x: 5, y: 6 },
|
||||
effect: Transition::FadeToWhite
|
||||
}
|
||||
.to_string(),
|
||||
"8 5,6 FX fade_w".to_string()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user