mirror of
https://github.com/ricoriedel/wipe.git
synced 2024-11-04 23:26:41 +00:00
Switch to approx
This commit is contained in:
parent
66a5ec78f3
commit
7c13c8838a
@ -30,6 +30,7 @@ impl Pattern for Invert {
|
||||
mod test {
|
||||
use super::*;
|
||||
use crate::MockPatternFactory;
|
||||
use approx::*;
|
||||
use mockall::predicate::eq;
|
||||
|
||||
#[test]
|
||||
@ -62,7 +63,7 @@ mod test {
|
||||
|
||||
let sampler = InvertFactory::new(Box::new(child)).create(&Config::default());
|
||||
|
||||
assert_eq!(0.3, sampler.sample(Vector::default()));
|
||||
assert_abs_diff_eq!(0.3, sampler.sample(Vector::default()));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -28,6 +28,7 @@ impl Pattern for Shift {
|
||||
mod test {
|
||||
use super::*;
|
||||
use crate::MockPatternFactory;
|
||||
use approx::*;
|
||||
use mockall::predicate::eq;
|
||||
|
||||
#[test]
|
||||
@ -61,7 +62,7 @@ mod test {
|
||||
|
||||
let sampler = ShiftFactory::new(Box::new(child)).create(&config);
|
||||
|
||||
assert_eq!(0.8, sampler.sample(Vector::default()));
|
||||
assert_abs_diff_eq!(0.8, sampler.sample(Vector::default()));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -38,6 +38,7 @@ impl Pattern for Slice {
|
||||
mod test {
|
||||
use super::*;
|
||||
use crate::MockPatternFactory;
|
||||
use approx::*;
|
||||
use mockall::predicate::eq;
|
||||
|
||||
#[test]
|
||||
@ -67,7 +68,7 @@ mod test {
|
||||
|
||||
let sampler = SliceFactory::new(Box::new(child), 4).create(&Config::default());
|
||||
|
||||
assert_eq!(1.0, sampler.sample(Vector::default()));
|
||||
assert_abs_diff_eq!(1.0, sampler.sample(Vector::default()));
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -81,7 +82,7 @@ mod test {
|
||||
|
||||
let sampler = SliceFactory::new(Box::new(child), 4).create(&Config::default());
|
||||
|
||||
assert_eq!(0.0, sampler.sample(Vector::default()));
|
||||
assert_abs_diff_eq!(0.0, sampler.sample(Vector::default()));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -30,6 +30,7 @@ impl Pattern for Swap {
|
||||
mod test {
|
||||
use super::*;
|
||||
use crate::MockPatternFactory;
|
||||
use approx::*;
|
||||
use mockall::predicate::eq;
|
||||
|
||||
#[test]
|
||||
@ -62,7 +63,7 @@ mod test {
|
||||
|
||||
let sampler = SwapFactory::new(Box::new(child)).create(&Config::default());
|
||||
|
||||
assert_eq!(0.4, sampler.sample(Vector::default()));
|
||||
assert_abs_diff_eq!(0.4, sampler.sample(Vector::default()));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
Loading…
Reference in New Issue
Block a user