-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain_test.ts
55 lines (49 loc) · 1.53 KB
/
main_test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import { assertEquals } from "https://deno.land/std@0.192.0/testing/asserts.ts";
import { SampleTest } from "./sample_test.ts";
import { CellLocation } from "./cell_location.ts";
Deno.test("Read no 1", () => {
//const test = new SampleTest('./files/sample_test.xlsx');
//test.analyze();
});
Deno.test("Cell Location: init", () => {
const location = new CellLocation('A', 1);
assertEquals(location.dispName, 'A1');
location.moveDown();
assertEquals(location.dispName, 'A2');
location.moveUp();
location.moveUp();
assertEquals(location.dispName, 'A1');
});
Deno.test("Cell Location: move down(1000times)", () => {
const location = new CellLocation('A', 1);
[...Array(1000)].forEach( (_)=> {
location.moveDown();
});
assertEquals(location.dispName, 'A1001');
});
Deno.test("Cell Location: move origin", () => {
const location = new CellLocation('A', 1);
[...Array(1000)].forEach( (_)=> {
location.moveDown();
});
location.moveToOrigin();
assertEquals(location.dispName, 'A1');
});
Deno.test("Cell Location: move right", () => {
const location = new CellLocation('A', 1);
[...Array(10)].forEach( (_)=> {
location.moveRight();
});
assertEquals(location.dispName, 'K1');
location.moveToOrigin();
assertEquals(location.dispName, 'A1');
});
Deno.test("Cell Location: move left", () => {
const location = new CellLocation('K', 1);
[...Array(20)].forEach( (_)=> {
location.moveLeft();
});
assertEquals(location.dispName, 'A1');
location.moveToOrigin();
assertEquals(location.dispName, 'K1');
});