programming-rust-examples/fern_sim/tests/unfurl.rs

17 lines
458 B
Rust
Raw Normal View History

2017-11-28 19:32:33 +00:00
// tests/unfurl.rs - Fiddleheads unfurl in sunlight
2021-06-13 20:22:37 +00:00
#![warn(rust_2018_idioms)]
#![allow(elided_lifetimes_in_paths)]
2017-11-28 19:32:33 +00:00
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());
}