Skip to content

Commit 8f8eec7

Browse files
committed
Add tests for Blob initializer
1 parent 2c9fd0c commit 8f8eec7

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

SQLiteTests/BlobTests.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,15 @@ class BlobTests : XCTestCase {
99
XCTAssertEqual(blob.toHex(), "000a141e28323c46505a6496faff")
1010
}
1111

12+
func test_init_array() {
13+
let blob = Blob(bytes: [42, 42, 42])
14+
XCTAssertEqual(blob.bytes, [42, 42, 42])
15+
}
16+
17+
func test_init_unsafeRawPointer() {
18+
let pointer = UnsafeMutablePointer<UInt8>.allocate(capacity: 3)
19+
pointer.initialize(to: 42, count: 3)
20+
let blob = Blob(bytes: pointer, length: 3)
21+
XCTAssertEqual(blob.bytes, [42, 42, 42])
22+
}
1223
}

0 commit comments

Comments
 (0)