summaryrefslogtreecommitdiff
path: root/Userland/Applications/Spreadsheet/Tests
diff options
context:
space:
mode:
authoru9g <43508353+u9g@users.noreply.github.com>2022-02-26 02:03:47 -0500
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2022-02-27 02:48:32 +0330
commitd2adf54e73027bea4d623d0f483658c0188d3dd8 (patch)
treef43bc62fb0c925348284c665bfc278ea8afc595c /Userland/Applications/Spreadsheet/Tests
parent99425c5adc38793c53b76094bea9840fafa64a18 (diff)
downloadserenity-d2adf54e73027bea4d623d0f483658c0188d3dd8.zip
Spreadsheet: Add sumProduct(If) functions
Diffstat (limited to 'Userland/Applications/Spreadsheet/Tests')
-rw-r--r--Userland/Applications/Spreadsheet/Tests/free-functions.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/Userland/Applications/Spreadsheet/Tests/free-functions.js b/Userland/Applications/Spreadsheet/Tests/free-functions.js
index dbc7de1220..9ad2629f3a 100644
--- a/Userland/Applications/Spreadsheet/Tests/free-functions.js
+++ b/Userland/Applications/Spreadsheet/Tests/free-functions.js
@@ -125,6 +125,16 @@ describe("Statistics", () => {
expect(max(R`B0:B9`)).toEqual(81);
});
+ test("sumProductIf", () => {
+ expect(sumProductIf).toBeDefined();
+ expect(sumProductIf((a, b) => b > 25, R`A0:A9`, R`B0:B9`)).toEqual(1800);
+ });
+
+ test("sumProduct", () => {
+ expect(sumProduct).toBeDefined();
+ expect(sumProduct(R`A0:A9`, R`B0:B9`)).toEqual(2025);
+ });
+
test("median", () => {
expect(median).toBeDefined();
expect(median(R`A0:A9`)).toEqual(4.5);