mirror of
https://github.com/ProgrammingRust/examples
synced 2024-11-15 06:12:49 +00:00
17 lines
458 B
Rust
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());
|
|
}
|