Skip to content

Commit

Permalink
fix code
Browse files Browse the repository at this point in the history
  • Loading branch information
qiweiii committed Jun 17, 2024
1 parent 0116c29 commit 61f1b6a
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import XCTest

@testable import Utils

final class H256Tests: XCTestCase {
final class Data32Tests: XCTestCase {
func testZero() throws {
let value = H256.zero
let value = Data32()
XCTAssertEqual(value.data, Data(repeating: 0, count: 32))
XCTAssertEqual(
value.description, "0x0000000000000000000000000000000000000000000000000000000000000000"
Expand All @@ -16,15 +16,15 @@ final class H256Tests: XCTestCase {
for i in 0 ..< 32 {
data[i] = UInt8(i)
}
let value = H256(data)!
let value = Data32(data)!
XCTAssertEqual(value.data, data)
XCTAssertEqual(
value.description, "0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f"
)
}

func testInitWithInvalidData() throws {
XCTAssertNil(H256(Data(repeating: 0, count: 31)))
XCTAssertNil(H256(Data(repeating: 0, count: 33)))
XCTAssertNil(Data32(Data(repeating: 0, count: 31)))
XCTAssertNil(Data32(Data(repeating: 0, count: 33)))
}
}

0 comments on commit 61f1b6a

Please sign in to comment.