Skip to content

Commit 98f7a3b

Browse files
Add test for hasher constant accross executions
1 parent 8a64527 commit 98f7a3b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import XCTest
2+
@testable import Cache
3+
4+
final class HasherConstantAccrossExecutionsTests: XCTestCase {
5+
func testHashValueRemainsTheSameAsLastTime() {
6+
// Warning: this test may start failing after a Swift Update
7+
let value = "some string with some values"
8+
var hasher = Hasher.constantAccrossExecutions()
9+
value.hash(into: &hasher)
10+
XCTAssertEqual(hasher.finalize(), -4706942985426845298)
11+
}
12+
}

0 commit comments

Comments
 (0)