Add unit tests

This commit is contained in:
2025-10-25 18:56:55 +03:00
parent ddc47abdde
commit bbb7f14650
38 changed files with 1051 additions and 526 deletions

View File

@@ -3,15 +3,16 @@ import Foundation
import DataLiteCore
struct StringTests {
@Test func testStringToSQLiteRawValue() {
@Test func stringToSQLiteValue() {
#expect("Hello, SQLite!".sqliteValue == .text("Hello, SQLite!"))
}
@Test func testSQLiteRawValueToString() {
@Test func stringFromSQLiteValue() {
#expect(String(SQLiteValue.text("Hello, SQLite!")) == "Hello, SQLite!")
#expect(String(SQLiteValue.int(42)) == nil)
#expect(String(SQLiteValue.blob(Data([0x01, 0x02]))) == nil)
#expect(String(SQLiteValue.real(42)) == nil)
#expect(String(SQLiteValue.blob(Data([0x42]))) == nil)
#expect(String(SQLiteValue.null) == nil)
}
}