From b9d44eb0226d5399f60ace3fe978b22174beb1e9 Mon Sep 17 00:00:00 2001 From: u9g Date: Fri, 4 Mar 2022 21:48:12 -0500 Subject: Spreadsheet: Add SplitRange class and CommonRange#filter --- Userland/Applications/Spreadsheet/Tests/basic.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'Userland/Applications') 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(); -- cgit v1.2.3