Skip to content

Commit 90493d1

Browse files
committed
Clean up test output
1 parent 84b39a2 commit 90493d1

File tree

9 files changed

+59
-48
lines changed

9 files changed

+59
-48
lines changed

test/test1409.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if (typeof exports != 'object') {
1414
var count = 0;
1515
alasql.fn.onInsert = function (r) {
1616
count++;
17-
console.log('this never happens!');
17+
// console.log('this never happens!');
1818
};
1919

2020
return alasql

test/test1643.js

Lines changed: 41 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,11 @@ describe('Test 1643 - Foreign Key and Primary Key Column Detection', function ()
6767
var fk = table2.xcolumns.Column1.foreignkey;
6868
assert.equal(fk.tableid, 'Table1', 'Foreign key should reference Table1');
6969
assert.equal(fk.columnid, 'Column1', 'Foreign key should reference Column1');
70-
assert.equal(fk.constraintid, 'FK_Table2_Column1', 'Foreign key should have correct constraint name');
70+
assert.equal(
71+
fk.constraintid,
72+
'FK_Table2_Column1',
73+
'Foreign key should have correct constraint name'
74+
);
7175
});
7276

7377
it('C) Multiple foreign keys on different columns should all be marked', function () {
@@ -138,7 +142,10 @@ describe('Test 1643 - Foreign Key and Primary Key Column Detection', function ()
138142
var table = db.tables.TableInline;
139143

140144
// Inline foreign key should set the foreignkey property
141-
assert(table.xcolumns.RefId.foreignkey, 'RefId should have foreignkey property from inline definition');
145+
assert(
146+
table.xcolumns.RefId.foreignkey,
147+
'RefId should have foreignkey property from inline definition'
148+
);
142149
});
143150

144151
it('F) Issue example - should detect foreign key in Table2.Column1', function () {
@@ -174,26 +181,14 @@ describe('Test 1643 - Foreign Key and Primary Key Column Detection', function ()
174181
var table2 = db.tables.Table2;
175182

176183
// Table1.Column1 should be marked as primary key
177-
assert(
178-
table1.xcolumns.Column1.primarykey,
179-
'Table1.Column1 should have primarykey property'
180-
);
184+
assert(table1.xcolumns.Column1.primarykey, 'Table1.Column1 should have primarykey property');
181185

182186
// Table2 columns should be marked as primary key
183-
assert(
184-
table2.xcolumns.Column1.primarykey,
185-
'Table2.Column1 should have primarykey property'
186-
);
187-
assert(
188-
table2.xcolumns.Column2.primarykey,
189-
'Table2.Column2 should have primarykey property'
190-
);
187+
assert(table2.xcolumns.Column1.primarykey, 'Table2.Column1 should have primarykey property');
188+
assert(table2.xcolumns.Column2.primarykey, 'Table2.Column2 should have primarykey property');
191189

192190
// Table2.Column1 should be marked as foreign key
193-
assert(
194-
table2.xcolumns.Column1.foreignkey,
195-
'Table2.Column1 should have foreignkey property'
196-
);
191+
assert(table2.xcolumns.Column1.foreignkey, 'Table2.Column1 should have foreignkey property');
197192
assert.equal(table2.xcolumns.Column1.foreignkey.tableid, 'Table1');
198193
assert.equal(table2.xcolumns.Column1.foreignkey.columnid, 'Column1');
199194
});
@@ -211,9 +206,13 @@ describe('Test 1643 - Foreign Key and Primary Key Column Detection', function ()
211206
assert.equal(res1, 1, 'First insert should succeed');
212207

213208
// Second insert with same primary key should fail
214-
assert.throws(function () {
215-
alasql('INSERT INTO PKTest VALUES (1, "Duplicate")');
216-
}, Error, 'Duplicate primary key should throw error');
209+
assert.throws(
210+
function () {
211+
alasql('INSERT INTO PKTest VALUES (1, "Duplicate")');
212+
},
213+
Error,
214+
'Duplicate primary key should throw error'
215+
);
217216

218217
// Insert with different primary key should succeed
219218
var res2 = alasql('INSERT INTO PKTest VALUES (2, "Second")');
@@ -245,9 +244,13 @@ describe('Test 1643 - Foreign Key and Primary Key Column Detection', function ()
245244
assert.equal(res1, 1, 'Insert with valid foreign key should succeed');
246245

247246
// Insert child with invalid foreign key should fail
248-
assert.throws(function () {
249-
alasql('INSERT INTO FKChild VALUES (2, 99, "Child2")');
250-
}, Error, 'Insert with invalid foreign key should throw error');
247+
assert.throws(
248+
function () {
249+
alasql('INSERT INTO FKChild VALUES (2, 99, "Child2")');
250+
},
251+
Error,
252+
'Insert with invalid foreign key should throw error'
253+
);
251254

252255
// Verify the foreignkey property is set correctly
253256
var db = alasql.databases['test' + test];
@@ -296,9 +299,13 @@ describe('Test 1643 - Foreign Key and Primary Key Column Detection', function ()
296299
assert.equal(res1, 1, 'First insert should succeed');
297300

298301
// Insert with same combination should fail
299-
assert.throws(function () {
300-
alasql('INSERT INTO CompositePK VALUES (1, 1, "Duplicate")');
301-
}, Error, 'Duplicate composite key should throw error');
302+
assert.throws(
303+
function () {
304+
alasql('INSERT INTO CompositePK VALUES (1, 1, "Duplicate")');
305+
},
306+
Error,
307+
'Duplicate composite key should throw error'
308+
);
302309

303310
// Insert with different Key1 but same Key2 should succeed
304311
var res2 = alasql('INSERT INTO CompositePK VALUES (2, 1, "Different Key1")');
@@ -336,9 +343,13 @@ describe('Test 1643 - Foreign Key and Primary Key Column Detection', function ()
336343
assert.equal(res1, 1, 'Insert with valid inline foreign key should succeed');
337344

338345
// Insert with invalid foreign key should fail
339-
assert.throws(function () {
340-
alasql('INSERT INTO InlineChild VALUES (2, 99)');
341-
}, Error, 'Insert with invalid inline foreign key should throw error');
346+
assert.throws(
347+
function () {
348+
alasql('INSERT INTO InlineChild VALUES (2, 99)');
349+
},
350+
Error,
351+
'Insert with invalid inline foreign key should throw error'
352+
);
342353

343354
// Verify foreignkey property is set
344355
var db = alasql.databases['test' + test];

test/test269.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ describe('Test 269 options', function () {
9090
ORDER BY a',
9191
[data1, data2]
9292
);
93-
console.log(res);
93+
// console.log(res);
9494
// Wrong with reduced rows
9595
assert.deepEqual(res, [
9696
[undefined, 40, 400],

test/test292.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ describe('Test 292 Nested searches', function () {
1515

1616
it.skip('2. Search inside select', function (done) {
1717
var res = alasql('SELECT (SEARCH b SUM(/c) FROM _) FROM ?', [data]);
18-
console.log(res);
18+
// console.log(res);
1919
done();
2020
});
2121

2222
it.skip('3. SELECT inside SEARCH', function (done) {
2323
var res = alasql('SEARCH a (SELECT SUM(c) FROM b) FROM ?');
24-
console.log(res);
24+
// console.log(res);
2525
done();
2626
});
2727

test/test329.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,26 @@ describe('Test 329 PROLOG', function () {
1414
it.skip('2. FACTS', function (done) {
1515
var res = alasql('CREATE GRAPH Alex > son > Michael');
1616
var res = alasql(':- son(Alex,Larissa)');
17-
console.log(res);
17+
// console.log(res);
1818
done();
1919
});
2020

2121
it.skip('3. RULES', function (done) {
2222
var res = alasql('son(@x,@y) :- parent(@y,@x)');
23-
console.log(res);
23+
// console.log(res);
2424
done();
2525
});
2626

2727
it.skip('4. QUERY', function (done) {
2828
var res = alasql('?- parent(@x,Alex)');
2929
var res = alasql('?- @x>parent>Alex)');
30-
console.log(res);
30+
// console.log(res);
3131
done();
3232
});
3333

3434
it.skip('5. Expression statement', function (done) {
3535
var res = alasql('= 100+1');
36-
console.log(res);
36+
// console.log(res);
3737
done();
3838
});
3939

test/test338.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ select top 3 b.col from b order by b.col desc;
4848
*/
4949
});
5050

51-
console.log(res);
51+
// console.log(res);
5252
// assert.deepEqual(res,1);
5353
done();
5454
});
@@ -67,7 +67,7 @@ select col from cte_for_b;
6767
*/
6868
});
6969

70-
console.log(res);
70+
// console.log(res);
7171
// assert.deepEqual(res,1);
7272
done();
7373
});

test/test339.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ insert into c (col) values (1), (2), (5);
121121
select col from c;
122122
*/
123123
});
124-
console.log(res);
124+
// console.log(res);
125125
assert.deepEqual(res.sort(), [1, 2, 3, 4]);
126126
done();
127127
});
@@ -136,7 +136,7 @@ insert into c (col) values (1), (2), (5);
136136
select col from c;
137137
*/
138138
});
139-
console.log(res);
139+
// console.log(res);
140140
assert.deepEqual(res.sort(), [3]);
141141
done();
142142
});
@@ -151,7 +151,7 @@ insert into c (col) values (1), (2), (5);
151151
select col from c;
152152
*/
153153
});
154-
console.log(res);
154+
// console.log(res);
155155
assert.deepEqual(res.sort(), [1, 2, 3]);
156156
done();
157157
});
@@ -166,7 +166,7 @@ insert into c (col) values (1), (2), (5);
166166
select col from c;
167167
*/
168168
});
169-
console.log(res);
169+
// console.log(res);
170170
assert.deepEqual(res.sort(), [1, 2]);
171171
done();
172172
});

test/test340.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe('Test 340 SET PARAMS', function () {
2626
*/
2727
});
2828

29-
console.log(res);
29+
// console.log(res);
3030
assert.deepEqual(res, [1, 'bar']);
3131

3232
done();

test/test407.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ describe('Test 407 - TWO JOINS', function () {
102102
var res = alasql(
103103
'SELECT one.id AS a, two.id AS b, three.id AS c FROM one LEFT JOIN two ON one.id = two.id RIGHT JOIN three ON two.id = three.id'
104104
);
105-
console.log(res);
105+
// console.log(res);
106106
assert.deepEqual(res, [
107107
[undefined, undefined, 'C'],
108108
[undefined, undefined, 'BC'],
@@ -116,7 +116,7 @@ describe('Test 407 - TWO JOINS', function () {
116116
var res = alasql(
117117
'SELECT one.id AS a, two.id AS b, three.id AS c FROM one LEFT JOIN two ON one.id = two.id OUTER JOIN three ON two.id = three.id'
118118
);
119-
console.log(res);
119+
// console.log(res);
120120
assert.deepEqual(res, [
121121
['A', undefined, undefined],
122122
['AB', 'AB', undefined],
@@ -170,7 +170,7 @@ describe('Test 407 - TWO JOINS', function () {
170170
var res = alasql(
171171
'SELECT one.id AS a, two.id AS b, three.id AS c FROM one RIGHT JOIN two ON one.id = two.id OUTER JOIN three ON two.id = three.id'
172172
);
173-
console.log(res);
173+
// console.log(res);
174174
assert.deepEqual(res, [
175175
[undefined, 'B', undefined],
176176
['AB', 'AB', undefined],

0 commit comments

Comments
 (0)