Skip to content

Commit

Permalink
fix upsert tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tanner0101 committed Jun 22, 2018
1 parent e085d3d commit d8a17a9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 24 deletions.
16 changes: 16 additions & 0 deletions Tests/PostgreSQLTests/PostgreSQLConnectionTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,21 @@ class PostgreSQLConnectionTests: XCTestCase {
print(c)
}
}

func testUpsert() throws {
let values: [(PostgreSQLUpsert.Identifier, PostgreSQLUpsert.Expression)] = []

var upsert: PostgreSQLUpsert

upsert = PostgreSQLUpsert.upsert(nil, values)
XCTAssertEqual(upsert.columns, [PostgreSQLColumnIdentifier.column(nil, .identifier("id"))])

upsert = PostgreSQLUpsert.upsert([], values)
XCTAssertEqual(upsert.columns, [PostgreSQLColumnIdentifier.column(nil, .identifier("id"))])

upsert = PostgreSQLUpsert.upsert([.column(nil, .identifier("field"))], values)
XCTAssertEqual(upsert.columns, [PostgreSQLColumnIdentifier.column(nil, .identifier("field"))])
}

static var allTests = [
("testBenchmark", testBenchmark),
Expand All @@ -560,6 +575,7 @@ class PostgreSQLConnectionTests: XCTestCase {
("testOrderBy", testOrderBy),
("testInvalidDate", testInvalidDate),
("testEmptyArray", testEmptyArray),
("testUpsert", testUpsert),
]
}

Expand Down
24 changes: 0 additions & 24 deletions Tests/PostgreSQLTests/SqlTests/PostgreSQLUpsertTests.swift

This file was deleted.

0 comments on commit d8a17a9

Please sign in to comment.