programming-rust-examples/fern_sim/tests/unfurl.rs
2021-06-13 13:22:37 -07:00

17 lines
458 B
Rust

// tests/unfurl.rs - Fiddleheads unfurl in sunlight
#![warn(rust_2018_idioms)]
#![allow(elided_lifetimes_in_paths)]
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());
}