mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 04:39:06 +00:00
Spreadsheet: Add SplitRange class and CommonRange#filter
This commit is contained in:
parent
1b6a1748f0
commit
b9d44eb022
Notes:
sideshowbarker
2024-07-19 01:59:31 +09:00
Author: https://github.com/u9g
Commit: b9d44eb022
Pull-request: https://github.com/SerenityOS/serenity/pull/12882
Reviewed-by: https://github.com/alimpfard
2 changed files with 46 additions and 1 deletions
|
@ -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();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue