programming-rust-examples/fern_sim/tests/unfurl.rs
2017-12-03 21:19:32 -08:00

15 lines
416 B
Rust

// tests/unfurl.rs - Fiddleheads unfurl in sunlight
extern crate fern_sim;
use fern_sim::Terrarium;
use std::time::Duration;
#[test]
fn test_fiddlehead_unfurling() {
let mut world = Terrarium::load("tests/unfurl_files/fiddlehead.tm");
assert!(world.fern(0).is_furled());
let one_hour = Duration::from_secs(60 * 60);
world.apply_sunlight(one_hour);
assert!(world.fern(0).is_fully_unfurled());
}