We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a758b0f commit 2ff0ed7Copy full SHA for 2ff0ed7
index.test.ts
@@ -327,6 +327,15 @@ test("scanRight1", t => {
327
);
328
});
329
330
+test("split", t => {
331
+ t.deepEqual(split([2, 1, 3, 4, 5, 6], 2), [
332
+ [2, 1],
333
+ [3, 4, 5, 6]
334
+ ]);
335
+ t.deepEqual(split([2, 1, 3, 4, 5, 6], 0), [[], [2, 1, 3, 4, 5, 6]]);
336
+ t.deepEqual(split([2, 1, 3, 4, 5, 6], 10), [[2, 1, 3, 4, 5, 6], []]);
337
+});
338
+
339
type Result<T> = Success<T> | Error;
340
341
interface Success<T> {
@@ -338,15 +347,6 @@ interface Error {
347
type: "error";
348
}
349
-test("split", t => {
342
- t.deepEqual(split([2, 1, 3, 4, 5, 6], 2), [
343
- [2, 1],
344
- [3, 4, 5, 6]
345
- ]);
346
- t.deepEqual(split([2, 1, 3, 4, 5, 6], 0), [[], [2, 1, 3, 4, 5, 6]]);
- t.deepEqual(split([2, 1, 3, 4, 5, 6], 10), [[2, 1, 3, 4, 5, 6], []]);
-});
-
350
function isSuccess<T>(result: Result<T>): result is Success<T> {
351
return result.type === "success";
352
0 commit comments