DataLiteCore swift package

This commit is contained in:
2025-04-24 23:48:46 +03:00
parent b0e52a72b7
commit 6f955b2c43
70 changed files with 7939 additions and 1 deletions

View File

@@ -0,0 +1,27 @@
import Testing
import Foundation
import DataLiteCore
struct RawRepresentableTests {
@Test func testRawRepresentableToSQLiteRawValue() {
let color: Color = .green
#expect(color.sqliteRawValue == .int(1))
}
@Test func testSQLiteRawValueToRawRepresentable() {
#expect(Color(.int(2)) == .blue)
#expect(Color(.int(42)) == nil)
#expect(Color(.text("red")) == nil)
#expect(Color(.blob(Data([0x01, 0x02]))) == nil)
#expect(Color(.null) == nil)
}
}
private extension RawRepresentableTests {
enum Color: Int, SQLiteRawRepresentable {
case red
case green
case blue
}
}