Remove SQLScript

This commit is contained in:
2025-10-25 18:33:03 +03:00
parent 954062f6c6
commit 835f7ee380
13 changed files with 16 additions and 1598 deletions

View File

@@ -1,64 +0,0 @@
import XCTest
import DataLiteCore
class SQLScriptTests: XCTestCase {
func testInitWithValidFile() throws {
let sqlScript = try SQLScript(
byResource: "valid_script",
extension: "sql",
in: .module
)
XCTAssertNotNil(sqlScript)
XCTAssertEqual(sqlScript?.count, 2)
}
func testInitWithEmptyFile() throws {
let sqlScript = try SQLScript(
byResource: "empty_script",
extension: "sql",
in: .module
)
XCTAssertNotNil(sqlScript)
XCTAssertEqual(sqlScript?.count, 0)
}
func testInitWithInvalidFile() throws {
XCTAssertThrowsError(
try SQLScript(
byResource: "invalid_script",
extension: "sql",
in: .module
)
) { error in
let error = error as NSError
XCTAssertEqual(error.domain, NSCocoaErrorDomain)
XCTAssertEqual(error.code, 259)
}
}
func testAccessingStatements() throws {
let sqlScript = try SQLScript(
byResource: "valid_script",
extension: "sql",
in: .module
)
let oneStatement = """
CREATE TABLE users (
id INTEGER PRIMARY KEY,
username TEXT NOT NULL,
email TEXT NOT NULL
)
"""
let twoStatement = """
INSERT INTO users (id, username, email)
VALUES
(1, 'john_doe', 'john@example.com'),
(2, 'jane_doe', 'jane@example.com')
"""
XCTAssertEqual(sqlScript?[0], oneStatement)
XCTAssertEqual(sqlScript?[1], twoStatement)
}
}