deno.land / x / simplestatistic@v7.7.1 / test / sum.test.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
/* eslint no-shadow: 0 */
const test = require("tap").test;const ss = require("../");
test("sum", function (t) { t.test("can get the sum of two numbers", function (t) { t.equal(ss.sum([1, 2]), 3); t.end(); });
t.test("the sum of no numbers is zero", function (t) { t.equal(ss.sum([]), 0); t.end(); }); t.end();});
test("sumSimple", function (t) { t.test("can get the sum of two numbers", function (t) { t.equal(ss.sumSimple([1, 2]), 3); t.end(); });
t.test("can get the sum of two numbers", function (t) { t.equal( ss.sumSimple([ 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7 ]), 15.299999999999999 ); t.equal( ss.sum([ 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7 ]), 15.3 ); t.end(); });
t.test("the sum of no numbers is zero", function (t) { t.equal(ss.sumSimple([]), 0); t.end(); }); t.end();});
simplestatistic

Version Info

Tagged at
2 years ago