Skip to content

Commit fe30bc3

Browse files
committed
more tests
1 parent 734a63b commit fe30bc3

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/views/array-view.test.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import {
77
ArrayIndexListView,
88
ArrayMaskView,
99
ArraySliceView,
10+
IndexListSelector,
11+
MaskSelector,
1012
SliceSelector,
1113
Slice,
1214
} from "../../src";
@@ -203,6 +205,12 @@ function dataProviderForCombineRead(): Array<unknown> {
203205
.subview('::2'),
204206
[1, 3, 5, 7, 9],
205207
],
208+
[
209+
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
210+
(source: Array<number>) => new ArrayIndexListView(source, { indexes: [...source.keys()] })
211+
.subview('::2'),
212+
[1, 3, 5, 7, 9],
213+
],
206214
[
207215
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
208216
(source: Array<number>) => new ArrayMaskView(source, { mask: [true, true, true, true, true, true, true, true, true, true] })
@@ -230,6 +238,22 @@ function dataProviderForCombineRead(): Array<unknown> {
230238
.subview(select([0, 2])),
231239
[1, 9],
232240
],
241+
[
242+
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
243+
(source: Array<number>) => view(source)
244+
.subview('::2')
245+
.subview(new MaskSelector([true, false, true, false, true]))
246+
.subview(new IndexListSelector([0, 2])),
247+
[1, 9],
248+
],
249+
[
250+
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
251+
(source: Array<number>) => view(source)
252+
.subview('::2')
253+
.subview(new MaskSelector(view([true, false, true, false, true])))
254+
.subview(new IndexListSelector(view([0, 2]))),
255+
[1, 9],
256+
],
233257
[
234258
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
235259
(source: Array<number>) => view(source)

0 commit comments

Comments
 (0)