Skip to content

Commit e743191

Browse files
committed
tests upd
1 parent 7c8387c commit e743191

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ $originalView = ArrayView::toView($originalArray);
5656
$originalView.subview(new MaskSelector([true, false, true, false, true])).toArray(); // [1, 3, 5]
5757
$originalView.subview(new IndexListSelector([1, 2, 4])).toArray(); // [2, 3, 5]
5858
$originalView.subview(new SliceSelector('::-1')).toArray(); // [5, 4, 3, 2, 1]
59+
$originalView.subview('::-1').toArray(); // [5, 4, 3, 2, 1]
5960

6061
$originalView.subview(new MaskSelector([true, false, true, false, true])).apply(fn ($x) => x * 10);
6162
print_r(originalArray); // [10, 2, 30, 4, 50]

tests/unit/Examples/ExamplesTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ public function testSubview()
4444
[5, 4, 3, 2, 1],
4545
$originalView->subview(new SliceSelector('::-1'))->toArray(),
4646
);
47+
$this->assertSame(
48+
[5, 4, 3, 2, 1],
49+
$originalView->subview('::-1')->toArray(),
50+
);
4751

4852
$originalView->subview(new MaskSelector([true, false, true, false, true]))
4953
->apply(fn(int $x) => $x * 10);

0 commit comments

Comments
 (0)