UPDATE: Adds unit tests for DEGREES and RADIANS (#495)
This commit is contained in:
committed by
GitHub
parent
6ce4756d55
commit
c8ae835bbe
@@ -9,6 +9,7 @@ mod test_currency;
|
|||||||
mod test_date_and_time;
|
mod test_date_and_time;
|
||||||
mod test_datedif_leap_month_end;
|
mod test_datedif_leap_month_end;
|
||||||
mod test_days360_month_end;
|
mod test_days360_month_end;
|
||||||
|
mod test_degrees_radians;
|
||||||
mod test_error_propagation;
|
mod test_error_propagation;
|
||||||
mod test_fn_average;
|
mod test_fn_average;
|
||||||
mod test_fn_averageifs;
|
mod test_fn_averageifs;
|
||||||
|
|||||||
22
base/src/test/test_degrees_radians.rs
Normal file
22
base/src/test/test_degrees_radians.rs
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
#![allow(clippy::unwrap_used)]
|
||||||
|
|
||||||
|
use crate::test::util::new_empty_model;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn fn_degrees_radians_arguments() {
|
||||||
|
let mut model = new_empty_model();
|
||||||
|
model._set("A1", "=DEGREES()");
|
||||||
|
model._set("A2", "=RADIANS()");
|
||||||
|
model._set("A3", "=RADIANS(180)");
|
||||||
|
model._set("A4", "=RADIANS(180, 2)");
|
||||||
|
model._set("A5", "=DEGREES(RADIANS(180))");
|
||||||
|
model._set("A6", "=DEGREES(1, 2)");
|
||||||
|
model.evaluate();
|
||||||
|
|
||||||
|
assert_eq!(model._get_text("A1"), *"#ERROR!");
|
||||||
|
assert_eq!(model._get_text("A2"), *"#ERROR!");
|
||||||
|
assert_eq!(model._get_text("A3"), *"3.141592654");
|
||||||
|
assert_eq!(model._get_text("A4"), *"#ERROR!");
|
||||||
|
assert_eq!(model._get_text("A5"), *"180");
|
||||||
|
assert_eq!(model._get_text("A6"), *"#ERROR!");
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user