Skip to content

Commit 9f89746

Browse files
author
Kyle Jessup
committed
Apostest
1 parent bacc382 commit 9f89746

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Tests/PerfectMySQLTests/PerfectMySQLTests.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ class PerfectMySQLTests: XCTestCase {
281281
let mysql = rawMySQL
282282
XCTAssert(mysql.query(statement: "DROP TABLE IF EXISTS all_data_types"))
283283

284-
let qres = mysql.query(statement: "CREATE TABLE `all_data_types` (`varchar` VARCHAR( 20 ),\n`tinyint` TINYINT,\n`text` TEXT,\n`date` DATE,\n`smallint` SMALLINT,\n`mediumint` MEDIUMINT,\n`int` INT,\n`bigint` BIGINT,\n`ubigint` BIGINT UNSIGNED,\n`float` FLOAT( 10, 2 ),\n`double` DOUBLE,\n`decimal` DECIMAL( 10, 2 ),\n`datetime` DATETIME,\n`timestamp` TIMESTAMP,\n`time` TIME,\n`year` YEAR,\n`char` CHAR( 10 ),\n`tinyblob` TINYBLOB,\n`tinytext` TINYTEXT,\n`blob` BLOB,\n`mediumblob` MEDIUMBLOB,\n`mediumtext` MEDIUMTEXT,\n`longblob` LONGBLOB,\n`longtext` LONGTEXT,\n`enum` ENUM( '1', '2', '3' ),\n`set` SET( '1', '2', '3' ),\n`bool` BOOL,\n`binary` BINARY( 20 ),\n`varbinary` VARBINARY( 20 ) ) ENGINE = MYISAM")
284+
let qres = mysql.query(statement: "CREATE TABLE `all_data_types` (`varchar` VARCHAR( 22 ),\n`tinyint` TINYINT,\n`text` TEXT,\n`date` DATE,\n`smallint` SMALLINT,\n`mediumint` MEDIUMINT,\n`int` INT,\n`bigint` BIGINT,\n`ubigint` BIGINT UNSIGNED,\n`float` FLOAT( 10, 2 ),\n`double` DOUBLE,\n`decimal` DECIMAL( 10, 2 ),\n`datetime` DATETIME,\n`timestamp` TIMESTAMP,\n`time` TIME,\n`year` YEAR,\n`char` CHAR( 10 ),\n`tinyblob` TINYBLOB,\n`tinytext` TINYTEXT,\n`blob` BLOB,\n`mediumblob` MEDIUMBLOB,\n`mediumtext` MEDIUMTEXT,\n`longblob` LONGBLOB,\n`longtext` LONGTEXT,\n`enum` ENUM( '1', '2', '3' ),\n`set` SET( '1', '2', '3' ),\n`bool` BOOL,\n`binary` BINARY( 20 ),\n`varbinary` VARBINARY( 20 ) ) ENGINE = MYISAM")
285285
XCTAssert(qres == true, mysql.errorMessage())
286286

287287
for _ in 1...2 {
@@ -290,7 +290,7 @@ class PerfectMySQLTests: XCTestCase {
290290
XCTAssert(prepRes, stmt1.errorMessage())
291291
XCTAssert(stmt1.paramCount() == 29)
292292

293-
stmt1.bindParam("varchar 20 string 👻")
293+
stmt1.bindParam("varchar '22' string 👻")
294294
stmt1.bindParam(1)
295295
stmt1.bindParam("text string")
296296
stmt1.bindParam("2015-10-21")
@@ -341,7 +341,7 @@ class PerfectMySQLTests: XCTestCase {
341341
let ok = results.forEachRow {
342342
e in
343343

344-
XCTAssertEqual(e[0] as? String, "varchar 20 string 👻")
344+
XCTAssertEqual(e[0] as? String, "varchar '22' string 👻")
345345
XCTAssertEqual(e[1] as? Int8, 1)
346346
XCTAssertEqual(e[2] as? String, "text string")
347347
XCTAssertEqual(e[3] as? String, "2015-10-21")
@@ -1016,12 +1016,13 @@ class PerfectMySQLTests: XCTestCase {
10161016
do {
10171017
let db = try getTestDB()
10181018
let t1 = db.table(TestTable1.self)
1019-
let newOne = TestTable1(id: 2000, name: "New One", integer: 40)
1019+
let newOne = TestTable1(id: 2000, name: "New ' One", integer: 40)
10201020
try t1.insert(newOne)
10211021
let j1 = t1.where(\TestTable1.id == newOne.id)
10221022
let j2 = try j1.select().map {$0}
10231023
XCTAssertEqual(try j1.count(), 1)
10241024
XCTAssertEqual(j2[0].id, 2000)
1025+
XCTAssertEqual(j2[0].name, "New ' One")
10251026
} catch {
10261027
XCTFail("\(error)")
10271028
}

0 commit comments

Comments
 (0)