From 243a01a638803c81947bb4abbd477cad18bd4a36 Mon Sep 17 00:00:00 2001 From: Nicolas <> Date: Sun, 3 Apr 2022 14:52:20 +0200 Subject: [PATCH] Add test --- src/fill/level.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/fill/level.rs b/src/fill/level.rs index 04da362..284da90 100644 --- a/src/fill/level.rs +++ b/src/fill/level.rs @@ -13,4 +13,17 @@ impl FillMode for LevelFillMode { fn sample(&self, level: f32, _: Vector) -> f32 { level } +} + +#[cfg(test)] +mod test { + use super::*; + + #[test] + fn sample() { + let mode = LevelFillMode::new(); + + assert_eq!(0.3, mode.sample(0.3, Vector::ZERO)); + assert_eq!(0.7, mode.sample(0.7, Vector::new(0.1, 0.2))); + } } \ No newline at end of file