diff options
author | u9g <git@u9g.dev> | 2022-03-04 21:48:12 -0500 |
---|---|---|
committer | Ali Mohammad Pur <Ali.mpfard@gmail.com> | 2022-03-09 10:22:20 +0330 |
commit | b9d44eb0226d5399f60ace3fe978b22174beb1e9 (patch) | |
tree | 42bbecbe383cb7a17aa21934278db89d45cbf139 /Userland/Applications | |
parent | 1b6a1748f06078084e53c8ff58802c97cf5bbf8d (diff) | |
download | serenity-b9d44eb0226d5399f60ace3fe978b22174beb1e9.zip |
Spreadsheet: Add SplitRange class and CommonRange#filter
Diffstat (limited to 'Userland/Applications')
-rw-r--r-- | Userland/Applications/Spreadsheet/Tests/basic.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Userland/Applications/Spreadsheet/Tests/basic.js b/Userland/Applications/Spreadsheet/Tests/basic.js index f8b6074ae9..26573aa1b9 100644 --- a/Userland/Applications/Spreadsheet/Tests/basic.js +++ b/Userland/Applications/Spreadsheet/Tests/basic.js @@ -189,6 +189,17 @@ describe("Range", () => { }); }); +describe("SplitRange", () => { + makeSheet(); + test("Range#filter => SplitRange", () => { + const range = R`A0:B`.filter(c => c.value() % 2 === 1); + expect(range.toString()).toEqual('SplitRange.fromNames("A0", "A2", "B0", "B2")'); + expect(resolve(range)).toEqual(["1", "3", "1", "9"]); + expect(numericResolve(range)).toEqual([1, 3, 1, 9]); + expect(count(range)).toEqual(4); + }); +}); + describe("R function", () => { makeSheet(); |