Add more test cases.

This commit is contained in:
JimiC
2017-06-22 23:12:39 +03:00
parent 56b5ec8a33
commit 315097fe1a
2 changed files with 21 additions and 1 deletions
+19
View File
@@ -127,6 +127,25 @@ function test_table() {
table.rows.add('name2', 7, 3.14);
}
function test_table2() {
var table = new sql.Table('#temp_table2');
table.create = true;
([
{ name: 'name', type: { typeName: 'VarChar', length: sql.MAX }, nullable: false },
{ name: 'type', type: { typeName: 'Int' }, nullable: false },
{ name: 'type', type: { typeName: 'Decimal', precision: 7, scale: 2 }, nullable: false }
] as any[])
.forEach((col: sql.IColumn) =>
table.columns.add(col.name, _getSqlType(col.type), { nullable: col.nullable }));
[['name', 42, 3.50], ['name2', 7, 3.14]].forEach((row: sql.IRow) => table.rows.add(...row));
}
function _getSqlType(type: any): sql.ISqlType {
return sql.TYPES[type.typeName](type.length | type.precision, type.scale);
}
function test_promise_returns() {
// Methods return a promises if the callback is omitted.
+2 -1
View File
@@ -6,6 +6,7 @@
],
"noImplicitAny": true,
"noImplicitThis": true,
"suppressImplicitAnyIndexErrors": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
@@ -19,4 +20,4 @@
"index.d.ts",
"mssql-tests.ts"
]
}
}