update: adds testing for MROUND, TRUNC, and INT (#542)
* update: available status for implemented functions * update: adds xlsx test for MROUND, TRUNC and INT * update: adds unit test for MROUND, TRUNC and INT
This commit is contained in:
40
base/src/test/test_mround_trunc_int
Normal file
40
base/src/test/test_mround_trunc_int
Normal file
@@ -0,0 +1,40 @@
|
||||
#![allow(clippy::unwrap_used)]
|
||||
|
||||
use crate::test::util::new_empty_model;
|
||||
|
||||
#[test]
|
||||
fn arguments() {
|
||||
let mut model = new_empty_model();
|
||||
model._set("A1", "=MROUND()");
|
||||
model._set("A2", "=MROUND(10)");
|
||||
model._set("A3", "=MROUND(10, 3)");
|
||||
model._set("A4", "=MROUND(10, 3, 1)");
|
||||
|
||||
model._set("A5", "=TRUNC()");
|
||||
model._set("A6", "=TRUNC(10)");
|
||||
model._set("A7", "=TRUNC(10.22, 1)");
|
||||
model._set("A8", "=TRUNC(10, 3, 1)");
|
||||
|
||||
model._set("A9", "=INT()");
|
||||
model._set("A10", "=INT(10.22)");
|
||||
model._set("A11", "=INT(10.22, 1)");
|
||||
model._set("A12", "=INT(10.22, 1, 2)");
|
||||
|
||||
|
||||
model.evaluate();
|
||||
|
||||
assert_eq!(model._get_text("A1"), *"#ERROR!");
|
||||
assert_eq!(model._get_text("A2"), *"#ERROR!");
|
||||
assert_eq!(model._get_text("A3"), *"9");
|
||||
assert_eq!(model._get_text("A4"), *"#ERROR!");
|
||||
|
||||
assert_eq!(model._get_text("A5"), *"#ERROR!");
|
||||
assert_eq!(model._get_text("A6"), *"#ERROR!");
|
||||
assert_eq!(model._get_text("A7"), *"10.2");
|
||||
assert_eq!(model._get_text("A8"), *"#ERROR!");
|
||||
|
||||
assert_eq!(model._get_text("A9"), *"#ERROR!");
|
||||
assert_eq!(model._get_text("A10"), *"10");
|
||||
assert_eq!(model._get_text("A11"), *"#ERROR!");
|
||||
assert_eq!(model._get_text("A12"), *"#ERROR!");
|
||||
}
|
||||
@@ -45,7 +45,7 @@ You can track the progress in this [GitHub issue](https://github.com/ironcalc/Ir
|
||||
| FLOOR.MATH | <Badge type="info" text="Not implemented yet" /> | – |
|
||||
| FLOOR.PRECISE | <Badge type="info" text="Not implemented yet" /> | – |
|
||||
| GCD | <Badge type="info" text="Not implemented yet" /> | – |
|
||||
| INT | <Badge type="info" text="Not implemented yet" /> | – |
|
||||
| INT | <Badge type="tip" text="Available" /> | – |
|
||||
| ISO.CEILING | <Badge type="info" text="Not implemented yet" /> | – |
|
||||
| LCM | <Badge type="info" text="Not implemented yet" /> | – |
|
||||
| LET | <Badge type="info" text="Not implemented yet" /> | – |
|
||||
@@ -56,7 +56,7 @@ You can track the progress in this [GitHub issue](https://github.com/ironcalc/Ir
|
||||
| MINVERSE | <Badge type="info" text="Not implemented yet" /> | – |
|
||||
| MMULT | <Badge type="info" text="Not implemented yet" /> | – |
|
||||
| MOD | <Badge type="tip" text="Available" /> | [MOD](math_and_trigonometry/mod) |
|
||||
| MROUND | <Badge type="info" text="Not implemented yet" /> | – |
|
||||
| MROUND | <Badge type="tip" text="Available" /> | – |
|
||||
| MULTINOMIAL | <Badge type="info" text="Not implemented yet" /> | – |
|
||||
| MUNIT | <Badge type="info" text="Not implemented yet" /> | – |
|
||||
| ODD | <Badge type="tip" text="Available" /> | [ODD](math_and_trigonometry/odd) |
|
||||
@@ -92,4 +92,4 @@ You can track the progress in this [GitHub issue](https://github.com/ironcalc/Ir
|
||||
| SUMXMY2 | <Badge type="info" text="Not implemented yet" /> | – |
|
||||
| TAN | <Badge type="tip" text="Available" /> | [TAN](math_and_trigonometry/tan) |
|
||||
| TANH | <Badge type="tip" text="Available" /> | [TANH](math_and_trigonometry/tanh) |
|
||||
| TRUNC | <Badge type="info" text="Not implemented yet" /> | – |
|
||||
| TRUNC | <Badge type="tip" text="Available" /> | – |
|
||||
|
||||
@@ -7,6 +7,5 @@ lang: en-US
|
||||
# INT
|
||||
|
||||
::: warning
|
||||
🚧 This function is not yet available in IronCalc.
|
||||
[Follow development here](https://github.com/ironcalc/IronCalc/labels/Functions)
|
||||
🚧 This function is implemented but currently lacks detailed documentation. For guidance, you may refer to the equivalent functionality in [Microsoft Excel documentation](https://support.microsoft.com/en-us/office/excel-functions-by-category-5f91f4e9-7b42-46d2-9bd1-63f26a86c0eb).
|
||||
:::
|
||||
@@ -7,6 +7,5 @@ lang: en-US
|
||||
# MROUND
|
||||
|
||||
::: warning
|
||||
🚧 This function is not yet available in IronCalc.
|
||||
[Follow development here](https://github.com/ironcalc/IronCalc/labels/Functions)
|
||||
🚧 This function is implemented but currently lacks detailed documentation. For guidance, you may refer to the equivalent functionality in [Microsoft Excel documentation](https://support.microsoft.com/en-us/office/excel-functions-by-category-5f91f4e9-7b42-46d2-9bd1-63f26a86c0eb).
|
||||
:::
|
||||
@@ -7,6 +7,5 @@ lang: en-US
|
||||
# TRUNC
|
||||
|
||||
::: warning
|
||||
🚧 This function is not yet available in IronCalc.
|
||||
[Follow development here](https://github.com/ironcalc/IronCalc/labels/Functions)
|
||||
🚧 This function is implemented but currently lacks detailed documentation. For guidance, you may refer to the equivalent functionality in [Microsoft Excel documentation](https://support.microsoft.com/en-us/office/excel-functions-by-category-5f91f4e9-7b42-46d2-9bd1-63f26a86c0eb).
|
||||
:::
|
||||
BIN
xlsx/tests/calc_tests/MROUND_TRUNC_INT.xlsx
Normal file
BIN
xlsx/tests/calc_tests/MROUND_TRUNC_INT.xlsx
Normal file
Binary file not shown.
Reference in New Issue
Block a user