mirror of
https://github.com/apple/swift-crypto
synced 2026-11-22 04:30:39 +00:00
Fix broken DataProtocol.hexString test utility (#230)
This commit is contained in:
1 parent
bc1c29221f
commit
c36d19a064
1 file changed
+8
-1
@@ -12,6 +12,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
import Foundation
|
||||
import XCTest
|
||||
|
||||
enum ByteHexEncodingErrors: Error {
|
||||
case incorrectHexValue
|
||||
@@ -70,7 +71,7 @@ extension DataProtocol {
|
||||
offset += 1
|
||||
}
|
||||
}
|
||||
count = offset
|
||||
count = offset * 2
|
||||
}
|
||||
return String(decoding: bytes, as: UTF8.self)
|
||||
}
|
||||
@@ -100,3 +101,9 @@ extension Data {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
final class BytesUtilTests: XCTestCase {
|
||||
func testHexStringUtils() throws {
|
||||
XCTAssertEqual(try Data(hexString: "deadbeef").hexString, "deadbeef")
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user