UPDATE: Adds unit tests for DEGREES and RADIANS (#495)

This commit is contained in:
Nicolás Hatcher Andrés
2025-11-01 11:23:29 +01:00
committed by GitHub
parent 6ce4756d55
commit c8ae835bbe
2 changed files with 23 additions and 0 deletions

View File

@@ -9,6 +9,7 @@ mod test_currency;
mod test_date_and_time;
mod test_datedif_leap_month_end;
mod test_days360_month_end;
mod test_degrees_radians;
mod test_error_propagation;
mod test_fn_average;
mod test_fn_averageifs;

View 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!");
}