-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
51 changed files
with
328 additions
and
345 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
import test from 'ava' | ||
import { prray } from '../src/prray' | ||
import Prray from '../src/prray' | ||
import { toPrrayPromise } from './test-utils' | ||
|
||
test('prray concat', async t => { | ||
t.deepEqual(prray([1, 2]).concat([3, 4]), prray([1, 2, 3, 4])) | ||
t.deepEqual(prray([1, 2]).concat([3, 4], [5, 6]), prray([1, 2, 3, 4, 5, 6])) | ||
t.deepEqual(prray([1, 2]).concat(3, [4, 5]), prray([1, 2, 3, 4, 5])) | ||
t.deepEqual(prray([[1]]).concat([2, [3]] as any), prray([[1], 2, [3]])) | ||
t.deepEqual(prray([[1]]).concat(4 as any, [5, [6]] as any), prray([[1], 4, 5, [6]])) | ||
t.deepEqual(Prray.from([1, 2]).concat([3, 4]), Prray.from([1, 2, 3, 4])) | ||
t.deepEqual(Prray.from([1, 2]).concat([3, 4], [5, 6]), Prray.from([1, 2, 3, 4, 5, 6])) | ||
t.deepEqual(Prray.from([1, 2]).concat(3, [4, 5]), Prray.from([1, 2, 3, 4, 5])) | ||
t.deepEqual(Prray.from([[1]]).concat([2, [3]] as any), Prray.from([[1], 2, [3]])) | ||
t.deepEqual(Prray.from([[1]]).concat(4 as any, [5, [6]] as any), Prray.from([[1], 4, 5, [6]])) | ||
|
||
const prr = prray([1, 2]) | ||
const prr = Prray.from([1, 2]) | ||
t.not(prr.concat([3, 4]), prr) // Immutable | ||
}) | ||
|
||
test('prraypromise concat', async t => { | ||
t.deepEqual(await toPrrayPromise([1, 2]).concat([3, 4]), prray([1, 2, 3, 4])) | ||
t.deepEqual(await toPrrayPromise([1, 2]).concat([3, 4], [5, 6]), prray([1, 2, 3, 4, 5, 6])) | ||
t.deepEqual(await toPrrayPromise([1, 2]).concat(3, [4, 5]), prray([1, 2, 3, 4, 5])) | ||
t.deepEqual(await toPrrayPromise([[1]]).concat([2, [3]] as any), prray([[1], 2, [3]])) | ||
t.deepEqual(await toPrrayPromise([[1]]).concat(4 as any, [5, [6]] as any), prray([[1], 4, 5, [6]])) | ||
t.deepEqual(await toPrrayPromise([1, 2]).concat([3, 4]), Prray.from([1, 2, 3, 4])) | ||
t.deepEqual(await toPrrayPromise([1, 2]).concat([3, 4], [5, 6]), Prray.from([1, 2, 3, 4, 5, 6])) | ||
t.deepEqual(await toPrrayPromise([1, 2]).concat(3, [4, 5]), Prray.from([1, 2, 3, 4, 5])) | ||
t.deepEqual(await toPrrayPromise([[1]]).concat([2, [3]] as any), Prray.from([[1], 2, [3]])) | ||
t.deepEqual(await toPrrayPromise([[1]]).concat(4 as any, [5, [6]] as any), Prray.from([[1], 4, 5, [6]])) | ||
|
||
const prr = prray([1, 2]) | ||
const prr = Prray.from([1, 2]) | ||
t.not(await toPrrayPromise(prr).concat([3, 4]), prr) // Immutable | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,31 @@ | ||
import test from 'ava' | ||
import { prray } from '../src/prray' | ||
import Prray from '../src/prray' | ||
import { toPrrayPromise } from './test-utils' | ||
|
||
test('prray copyWithin', async t => { | ||
const arr = [1, 2, 3, 4, 5] | ||
const prr = prray([1, 2, 3, 4, 5]) | ||
const prr = Prray.from([1, 2, 3, 4, 5]) | ||
|
||
t.is(prr.copyWithin(-2, 0), prr) | ||
|
||
t.deepEqual(prr.copyWithin(-2, 0), prray(arr.copyWithin(-2, 0))) | ||
t.deepEqual(prr.copyWithin(0, 3), prray(arr.copyWithin(0, 3))) | ||
t.deepEqual(prr.copyWithin(0, 3, 4), prray(arr.copyWithin(0, 3, 4))) | ||
t.deepEqual(prr.copyWithin(-2, -3, -1), prray(arr.copyWithin(-2, -3, -1))) | ||
t.deepEqual(prr.copyWithin(-2, 0), Prray.from(arr.copyWithin(-2, 0))) | ||
t.deepEqual(prr.copyWithin(0, 3), Prray.from(arr.copyWithin(0, 3))) | ||
t.deepEqual(prr.copyWithin(0, 3, 4), Prray.from(arr.copyWithin(0, 3, 4))) | ||
t.deepEqual(prr.copyWithin(-2, -3, -1), Prray.from(arr.copyWithin(-2, -3, -1))) | ||
|
||
t.is(prr.copyWithin(-2, -3, -1), prr) // mutable | ||
}) | ||
|
||
test('prraypromise copyWithin', async t => { | ||
const arr = [1, 2, 3, 4, 5] | ||
const prr = prray([1, 2, 3, 4, 5]) | ||
const prr = Prray.from([1, 2, 3, 4, 5]) | ||
|
||
t.is(await toPrrayPromise(prr).copyWithin(-2, 0), prr) | ||
|
||
t.deepEqual(await toPrrayPromise(prr).copyWithin(-2, 0), prray(arr.copyWithin(-2, 0))) | ||
t.deepEqual(await toPrrayPromise(prr).copyWithin(0, 3), prray(arr.copyWithin(0, 3))) | ||
t.deepEqual(await toPrrayPromise(prr).copyWithin(0, 3, 4), prray(arr.copyWithin(0, 3, 4))) | ||
t.deepEqual(await toPrrayPromise(prr).copyWithin(-2, -3, -1), prray(arr.copyWithin(-2, -3, -1))) | ||
t.deepEqual(await toPrrayPromise(prr).copyWithin(-2, 0), Prray.from(arr.copyWithin(-2, 0))) | ||
t.deepEqual(await toPrrayPromise(prr).copyWithin(0, 3), Prray.from(arr.copyWithin(0, 3))) | ||
t.deepEqual(await toPrrayPromise(prr).copyWithin(0, 3, 4), Prray.from(arr.copyWithin(0, 3, 4))) | ||
t.deepEqual(await toPrrayPromise(prr).copyWithin(-2, -3, -1), Prray.from(arr.copyWithin(-2, -3, -1))) | ||
|
||
t.is(await toPrrayPromise(prr).copyWithin(-2, -3, -1), prr) // mutable | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.