Skip to content

Commit 3b4a3d1

Browse files
committed
Update dependencies and format
1 parent bf69bfb commit 3b4a3d1

File tree

4 files changed

+256
-263
lines changed

4 files changed

+256
-263
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,17 @@
5252
"blueimp-md5": "2.19.0",
5353
"cmdmix": "2.2.2",
5454
"dom-storage": "2.1.0",
55-
"esbuild": "0.23.1",
55+
"esbuild": "0.24.0",
5656
"git-branch-is": "4.0.0",
5757
"husky": "8.0.3",
5858
"jison": "^0.4.18",
5959
"mocha": "10.7.3",
6060
"mocha.parallel": "0.15.6",
6161
"open": "10.1.0",
62-
"prettier": "3.3.3",
62+
"prettier": "3.4.2",
6363
"react-native-fetch-blob": "^0.10.8",
6464
"react-native-fs": "^2.20.0",
65-
"rexreplace": "7.1.11",
65+
"rexreplace": "7.1.12",
6666
"strftime": "0.10.3",
6767
"tabletop": "1.6.3",
6868
"uglify-js": "3.19.3"

test/test1977.js

Lines changed: 50 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@ if (typeof exports === 'object') {
44
}
55

66
describe('Test 1977 - BigInt support', function () {
7-
87
it('A) Should sum, find max, min, average of BigInt values, and calculate TOTAL', function () {
9-
var data = [
10-
{a: 9045645645644442n}, {a: 9147483647334432n}, {a: 20n}, {a : 45875651254783254n}
11-
];
8+
var data = [{a: 9045645645644442n}, {a: 9147483647334432n}, {a: 20n}, {a: 45875651254783254n}];
129

1310
var res = alasql(
1411
`SELECT SUM(a) AS sum_a,
@@ -20,19 +17,19 @@ describe('Test 1977 - BigInt support', function () {
2017
[data]
2118
);
2219

23-
assert.deepEqual(res, [{
24-
sum_a: 64068780547762148n,
25-
max_a: 45875651254783254n,
26-
min_a: 20n,
27-
avg_a: 16017195136940537n,
28-
total_a: 64068780547762148n,
29-
}]);
20+
assert.deepEqual(res, [
21+
{
22+
sum_a: 64068780547762148n,
23+
max_a: 45875651254783254n,
24+
min_a: 20n,
25+
avg_a: 16017195136940537n,
26+
total_a: 64068780547762148n,
27+
},
28+
]);
3029
});
3130

3231
it('B) Aggregate functions with mixed Number and BigInt types', function () {
33-
var data = [
34-
{a: 1}, {a: 2}, {a: 3}, {a: 4}, {a: 9147483647334432n}
35-
];
32+
var data = [{a: 1}, {a: 2}, {a: 3}, {a: 4}, {a: 9147483647334432n}];
3633

3734
var res = alasql(
3835
`SELECT SUM(a) AS sum_a,
@@ -44,20 +41,19 @@ describe('Test 1977 - BigInt support', function () {
4441
[data]
4542
);
4643

47-
assert.deepEqual(res, [{
48-
sum_a: 9147483647334442n,
49-
max_a: 9147483647334432n,
50-
min_a: 1n,
51-
avg_a: 1829496729466888n,
52-
total_a: 9147483647334442n,
53-
}]);
44+
assert.deepEqual(res, [
45+
{
46+
sum_a: 9147483647334442n,
47+
max_a: 9147483647334432n,
48+
min_a: 1n,
49+
avg_a: 1829496729466888n,
50+
total_a: 9147483647334442n,
51+
},
52+
]);
5453
});
5554

5655
it('C) Aggregate functions with negative BigInt values', function () {
57-
var data = [
58-
{a: -9045645645644442n},
59-
{a: -9147483647334432n}
60-
];
56+
var data = [{a: -9045645645644442n}, {a: -9147483647334432n}];
6157

6258
var res = alasql(
6359
`SELECT SUM(a) AS sum_a,
@@ -69,19 +65,21 @@ describe('Test 1977 - BigInt support', function () {
6965
[data]
7066
);
7167

72-
assert.deepEqual(res, [{
73-
sum_a: -18193129292978874n,
74-
max_a: -9045645645644442n,
75-
min_a: -9147483647334432n,
76-
avg_a: -9096564646489437n,
77-
total_a: -18193129292978874n,
78-
}]);
68+
assert.deepEqual(res, [
69+
{
70+
sum_a: -18193129292978874n,
71+
max_a: -9045645645644442n,
72+
min_a: -9147483647334432n,
73+
avg_a: -9096564646489437n,
74+
total_a: -18193129292978874n,
75+
},
76+
]);
7977
});
8078

8179
it('D) Aggregate functions with large BigInt values', function () {
8280
var data = [
8381
{a: BigInt('123456789012345678901234567890')},
84-
{a: BigInt('987654321098765432109876543210')}
82+
{a: BigInt('987654321098765432109876543210')},
8583
];
8684

8785
var res = alasql(
@@ -94,20 +92,19 @@ describe('Test 1977 - BigInt support', function () {
9492
[data]
9593
);
9694

97-
assert.deepEqual(res, [{
98-
sum_a: BigInt('1111111110111111111011111111100'),
99-
max_a: BigInt('987654321098765432109876543210'),
100-
min_a: BigInt('123456789012345678901234567890'),
101-
avg_a: BigInt('555555555055555555505555555550'),
102-
total_a: BigInt('1111111110111111111011111111100'),
103-
}]);
95+
assert.deepEqual(res, [
96+
{
97+
sum_a: BigInt('1111111110111111111011111111100'),
98+
max_a: BigInt('987654321098765432109876543210'),
99+
min_a: BigInt('123456789012345678901234567890'),
100+
avg_a: BigInt('555555555055555555505555555550'),
101+
total_a: BigInt('1111111110111111111011111111100'),
102+
},
103+
]);
104104
});
105105

106106
it('E) Aggregate functions with zero sum (positive and negative BigInt)', function () {
107-
var data = [
108-
{a: 12345678901234567890n},
109-
{a: -12345678901234567890n}
110-
];
107+
var data = [{a: 12345678901234567890n}, {a: -12345678901234567890n}];
111108

112109
var res = alasql(
113110
`SELECT SUM(a) AS sum_a,
@@ -119,12 +116,14 @@ describe('Test 1977 - BigInt support', function () {
119116
[data]
120117
);
121118

122-
assert.deepEqual(res, [{
123-
sum_a: 0n,
124-
max_a: 12345678901234567890n,
125-
min_a: -12345678901234567890n,
126-
avg_a: 0n,
127-
total_a: 0n,
128-
}]);
119+
assert.deepEqual(res, [
120+
{
121+
sum_a: 0n,
122+
max_a: 12345678901234567890n,
123+
min_a: -12345678901234567890n,
124+
avg_a: 0n,
125+
total_a: 0n,
126+
},
127+
]);
129128
});
130129
});

test/test2000.js

Lines changed: 48 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
const alasql = require('../dist/alasql.js');
1+
const alasql = require('../dist/alasql.js');
22

33
if (typeof exports === 'object') {
44
var assert = require('assert');
55
}
66

77
describe('Test 2000', function () {
8-
9-
before(function () {
8+
before(function () {
109
alasql('create database test');
1110
alasql('use test');
1211
});
@@ -15,54 +14,52 @@ describe('Test 2000', function () {
1514
alasql('drop database test');
1615
});
1716

18-
it('A) Select from memory', () => {
19-
alasql('CREATE TABLE osoby (id INT, meno STRING)');
20-
alasql('INSERT INTO osoby VALUES (1, "John"), (2, "Jane"), (3, "Jake")');
21-
const result = alasql('SELECT * FROM osoby');
22-
23-
assert.deepEqual(result, [
24-
{ id: 1, meno: "John" },
25-
{ id: 2, meno: "Jane" },
26-
{ id: 3, meno: "Jake" }
27-
]);
28-
});
29-
30-
it('B) Max from memory', () => {
31-
alasql('CREATE TABLE produkty (id INT, cena INT)');
32-
alasql('INSERT INTO produkty VALUES (1, 100), (2, 150), (3, 200)');
33-
const result = alasql('SELECT MAX(cena) AS maxCena FROM produkty');
34-
35-
assert.strictEqual(result[0].maxCena, 200);
36-
});
37-
38-
it('C) Min from memory', () => {
39-
alasql('CREATE TABLE produkty3 (id INT, cena INT)');
40-
alasql('INSERT INTO produkty3 VALUES (1, 100), (2, 150), (3, 200)');
41-
const result = alasql('SELECT MIN(cena) AS minCena FROM produkty3');
42-
43-
assert.strictEqual(result[0].minCena, 100);
44-
});
45-
46-
it('Total from memory', () => {
47-
alasql('CREATE TABLE produkty4 (id INT, cena INT)');
48-
alasql('INSERT INTO produkty4 VALUES (1, 100), (2, 150), (3, 200)');
49-
50-
const result = alasql('SELECT TOTAL(cena) AS totalCena FROM produkty4');
51-
52-
assert.strictEqual(result[0].totalCena, 450);
53-
});
54-
55-
it('E) Avg from memory', () => {
56-
alasql('CREATE TABLE produkty2 (id INT, cena INT)');
57-
alasql('INSERT INTO produkty2 VALUES (1, 100), (2, 150), (3, 200)');
58-
const result = alasql('SELECT AVG(cena) AS avgCena FROM produkty2');
59-
60-
assert.strictEqual(result[0].avgCena, 150);
61-
});
62-
63-
64-
65-
it('F) SUM with Round function from memory', function () {
17+
it('A) Select from memory', () => {
18+
alasql('CREATE TABLE osoby (id INT, meno STRING)');
19+
alasql('INSERT INTO osoby VALUES (1, "John"), (2, "Jane"), (3, "Jake")');
20+
const result = alasql('SELECT * FROM osoby');
21+
22+
assert.deepEqual(result, [
23+
{id: 1, meno: 'John'},
24+
{id: 2, meno: 'Jane'},
25+
{id: 3, meno: 'Jake'},
26+
]);
27+
});
28+
29+
it('B) Max from memory', () => {
30+
alasql('CREATE TABLE produkty (id INT, cena INT)');
31+
alasql('INSERT INTO produkty VALUES (1, 100), (2, 150), (3, 200)');
32+
const result = alasql('SELECT MAX(cena) AS maxCena FROM produkty');
33+
34+
assert.strictEqual(result[0].maxCena, 200);
35+
});
36+
37+
it('C) Min from memory', () => {
38+
alasql('CREATE TABLE produkty3 (id INT, cena INT)');
39+
alasql('INSERT INTO produkty3 VALUES (1, 100), (2, 150), (3, 200)');
40+
const result = alasql('SELECT MIN(cena) AS minCena FROM produkty3');
41+
42+
assert.strictEqual(result[0].minCena, 100);
43+
});
44+
45+
it('Total from memory', () => {
46+
alasql('CREATE TABLE produkty4 (id INT, cena INT)');
47+
alasql('INSERT INTO produkty4 VALUES (1, 100), (2, 150), (3, 200)');
48+
49+
const result = alasql('SELECT TOTAL(cena) AS totalCena FROM produkty4');
50+
51+
assert.strictEqual(result[0].totalCena, 450);
52+
});
53+
54+
it('E) Avg from memory', () => {
55+
alasql('CREATE TABLE produkty2 (id INT, cena INT)');
56+
alasql('INSERT INTO produkty2 VALUES (1, 100), (2, 150), (3, 200)');
57+
const result = alasql('SELECT AVG(cena) AS avgCena FROM produkty2');
58+
59+
assert.strictEqual(result[0].avgCena, 150);
60+
});
61+
62+
it('F) SUM with Round function from memory', function () {
6663
var data = [
6764
{
6865
a: null,
@@ -105,8 +102,6 @@ describe('Test 2000', function () {
105102
f: 13,
106103
},
107104
]);
108-
109-
110105
});
111106

112107
it('G) MAX/MIN/SUM with Round or Ceil function from memory', function () {
@@ -160,4 +155,3 @@ describe('Test 2000', function () {
160155
]);
161156
});
162157
});
163-

0 commit comments

Comments
 (0)