update tests
This commit is contained in:
parent
8c3aa1d0d4
commit
345851d8b4
@ -456,23 +456,9 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn left_function_test() {
|
||||
let area_target = 0.9600000000000001;
|
||||
|
||||
do_test(Riemann::Left, area_target);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn middle_function_test() {
|
||||
let area_target = 0.92;
|
||||
|
||||
do_test(Riemann::Middle, area_target);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn right_function_test() {
|
||||
let area_target = 0.8800000000000001;
|
||||
|
||||
do_test(Riemann::Right, area_target);
|
||||
fn function_entry_test() {
|
||||
do_test(Riemann::Left, 0.9600000000000001);
|
||||
do_test(Riemann::Middle, 0.92);
|
||||
do_test(Riemann::Right, 0.8800000000000001);
|
||||
}
|
||||
}
|
||||
|
||||
@ -44,6 +44,9 @@ impl FunctionOutput {
|
||||
/// expected
|
||||
#[test]
|
||||
fn function_output_test() {
|
||||
let empty_value = vec![Value::new(0, 0)];
|
||||
let empty_bars = (vec![Bar::new(0.0, 0.0)], 0.0);
|
||||
|
||||
let mut function_output = FunctionOutput::new_empty();
|
||||
assert!(function_output.back.is_none());
|
||||
assert!(function_output.integral.is_none());
|
||||
@ -51,23 +54,23 @@ fn function_output_test() {
|
||||
assert!(function_output.extrema.is_none());
|
||||
assert!(function_output.roots.is_none());
|
||||
|
||||
function_output.back = Some(vec![Value::new(0, 0)]);
|
||||
function_output.back = Some(empty_value.clone());
|
||||
function_output.invalidate_back();
|
||||
assert!(function_output.back.is_none());
|
||||
|
||||
function_output.integral = Some((vec![Bar::new(0.0, 0.0)], 0.0));
|
||||
function_output.integral = Some(empty_bars.clone());
|
||||
function_output.invalidate_integral();
|
||||
assert!(function_output.integral.is_none());
|
||||
|
||||
function_output.derivative = Some(vec![Value::new(0, 0)]);
|
||||
function_output.derivative = Some(empty_value.clone());
|
||||
function_output.invalidate_derivative();
|
||||
assert!(function_output.derivative.is_none());
|
||||
|
||||
function_output.back = Some(vec![Value::new(0, 0)]);
|
||||
function_output.integral = Some((vec![Bar::new(0.0, 0.0)], 0.0));
|
||||
function_output.derivative = Some(vec![Value::new(0, 0)]);
|
||||
function_output.extrema = Some(vec![Value::new(0, 0)]);
|
||||
function_output.roots = Some(vec![Value::new(0, 0)]);
|
||||
function_output.back = Some(empty_value.clone());
|
||||
function_output.integral = Some(empty_bars);
|
||||
function_output.derivative = Some(empty_value.clone());
|
||||
function_output.extrema = Some(empty_value.clone());
|
||||
function_output.roots = Some(empty_value);
|
||||
|
||||
function_output.invalidate_whole();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user