update: adds docs, unit tests and xlsx tests for EVEN and ODD functions (#517)
* update: adds unit test for EVEN and ODD functions * update: adds xlsx test for EVEN and ODD functions * update: adds EVEN and ODD doc pages * update: Math and Trigonometry main page links to new functions * update: changes to functions badge type in main Math and Trigonometry page
This commit is contained in:
23
base/src/test/test_even_odd
Normal file
23
base/src/test/test_even_odd
Normal file
@@ -0,0 +1,23 @@
|
||||
#![allow(clippy::unwrap_used)]
|
||||
|
||||
use crate::test::util::new_empty_model;
|
||||
|
||||
#[test]
|
||||
fn arguments() {
|
||||
let mut model = new_empty_model();
|
||||
model._set("A1", "=EVEN(2)");
|
||||
model._set("A2", "=ODD(2)");
|
||||
model._set("A3", "=EVEN()");
|
||||
model._set("A4", "=ODD()");
|
||||
model._set("A5", "=EVEN(1, 2)");
|
||||
model._set("A6", "=ODD(1, 2)");
|
||||
|
||||
model.evaluate();
|
||||
|
||||
assert_eq!(model._get_text("A1"), *"2");
|
||||
assert_eq!(model._get_text("A2"), *"3");
|
||||
assert_eq!(model._get_text("A3"), *"#ERROR!");
|
||||
assert_eq!(model._get_text("A4"), *"#ERROR!");
|
||||
assert_eq!(model._get_text("A5"), *"#ERROR!");
|
||||
assert_eq!(model._get_text("A6"), *"#ERROR!");
|
||||
}
|
||||
Reference in New Issue
Block a user