-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.js
63 lines (58 loc) · 1.54 KB
/
start.js
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
56
57
58
59
60
61
62
63
import StringCalculator from "./StringCalculator.js";
let case1,
case2,
case3,
case4,
case5,
case6,
case7,
case8,
case9,
case10,
case11;
//Test Cases
case1 = "1,2,5";
case2 = "1,2,5000";
case3 = "1,\n2000,4000";
case4 = "1,\n2,5";
case5 = "//;\n1;3;4";
case6 = "//%\n1%3%4";
case7 = "//$\n1$2$3";
case8 = "//@\n2@3@8";
case9 = "//***\n1***2***3";
case10 = "//$,@\n1$2@3";
case11 = "//32***6\n1000**9*2000***9000";
const firstTest = new StringCalculator(case1);
const secondTest = new StringCalculator(case2);
const thirdTest = new StringCalculator(case3);
const fourthTest = new StringCalculator(case4);
const fifthTest = new StringCalculator(case5);
const sixthTest = new StringCalculator(case6);
const seventhTest = new StringCalculator(case7);
const eighthTest = new StringCalculator(case8);
const ninethTest = new StringCalculator(case9);
const tenthTest = new StringCalculator(case10);
const eleventhTest = new StringCalculator(case11);
//Adding numbers
firstTest.add();
secondTest.add();
thirdTest.add();
fourthTest.add();
fifthTest.add();
sixthTest.add();
seventhTest.add();
eighthTest.add();
ninethTest.add();
tenthTest.add();
eleventhTest.add();
console.log(firstTest.totalNum());
console.log(secondTest.totalNum());
console.log(thirdTest.totalNum());
console.log(fourthTest.totalNum());
console.log(fifthTest.totalNum());
console.log(sixthTest.totalNum());
console.log(seventhTest.totalNum());
console.log(eighthTest.totalNum());
console.log(ninethTest.totalNum());
console.log(tenthTest.totalNum());
console.log(eleventhTest.totalNum());