UNPKG

1.35 kBJavaScriptView Raw
1"use strict";
2
3module.exports = function (t, a) {
4 a(t.up(), "", "Up: No argument");
5 a(t.up({}), "", "Up: Not a number");
6 a(t.up(-34), "", "Up: Negative");
7 a(t.up(34), "\x1b[34A", "Up: Positive");
8
9 a(t.down(), "", "Down: No argument");
10 a(t.down({}), "", "Down: Not a number");
11 a(t.down(-34), "", "Down: Negative");
12 a(t.down(34), "\x1b[34B", "Down: Positive");
13
14 a(t.right(), "", "Right: No argument");
15 a(t.right({}), "", "Right: Not a number");
16 a(t.right(-34), "", "Right: Negative");
17 a(t.right(34), "\x1b[34C", "Right: Positive");
18
19 a(t.left(), "", "Left: No argument");
20 a(t.left({}), "", "Left: Not a number");
21 a(t.left(-34), "", "Left: Negative");
22 a(t.left(34), "\x1b[34D", "Left: Positive");
23
24 a(t(), "", "Move: No arguments");
25 a(t({}, {}), "", "Move: Bad arguments");
26 a(t({}, 12), "\x1b[12B", "Move: One direction");
27 a(t(0, -12), "\x1b[12A", "Move: One negative direction");
28 a(t(-42, -2), "\x1b[42D\x1b[2A", "Move: two negatives");
29 a(t(2, 35), "\x1b[2C\x1b[35B", "Move: two positives");
30
31 a(t.to(), "\x1b[1;1H", "MoveTo: No arguments");
32 a(t.to({}, {}), "\x1b[1;1H", "MoveTo: Bad arguments");
33 a(t.to({}, 12), "\x1b[13;1H", "MoveTo: One direction");
34 a(t.to(2, -12), "\x1b[1;3H", "MoveTo: One negative direction");
35 a(t.to(-42, -2), "\x1b[1;1H", "MoveTo: two negatives");
36 a(t.to(2, 35), "\x1b[36;3H", "MoveTo: two positives");
37};