Skip to content

Commit b53004f

Browse files
🧪 test: Split test execution.
1 parent 530b64c commit b53004f

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

test/src/reversed.js

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@ import test from 'ava';
22

33
import {reversed} from '../../src/index.js';
44

5-
test('reversed', (t) => {
6-
const x = function (A, B) {
7-
t.deepEqual(Array.from(reversed(A)), B);
8-
t.deepEqual(Array.from(reversed(B)), A);
9-
};
5+
const macro = (t, A, B) => {
6+
t.deepEqual(Array.from(reversed(A)), B);
7+
t.deepEqual(Array.from(reversed(B)), A);
8+
};
109

11-
x([], []);
12-
x([1], [1]);
13-
x([1, 2, 3], [3, 2, 1]);
14-
x([1, 2, 3, 4, 5, 6], [6, 5, 4, 3, 2, 1]);
15-
x([1, 2, 3, 4, 5, 6, 7, 8, 9], [9, 8, 7, 6, 5, 4, 3, 2, 1]);
16-
});
10+
macro.title = (title, A, B) =>
11+
title ?? `reversed(${JSON.stringify(A)}) = ${JSON.stringify(B)}`;
12+
13+
test(macro, [], []);
14+
test(macro, [1], [1]);
15+
test(macro, [1, 2, 3], [3, 2, 1]);
16+
test(macro, [1, 2, 3, 4, 5, 6], [6, 5, 4, 3, 2, 1]);
17+
test(macro, [1, 2, 3, 4, 5, 6, 7, 8, 9], [9, 8, 7, 6, 5, 4, 3, 2, 1]);

0 commit comments

Comments
 (0)