diff --git a/Tests/CapsuleTests/CapsuleSmokeTests.swift b/Tests/CapsuleTests/CapsuleSmokeTests.swift index 7d5d7ac8..1435ad63 100644 --- a/Tests/CapsuleTests/CapsuleSmokeTests.swift +++ b/Tests/CapsuleTests/CapsuleSmokeTests.swift @@ -404,37 +404,6 @@ final class CapsuleSmokeTests: CollectionTestCase { } } -fileprivate final class CollidableInt: CustomStringConvertible, Equatable, Hashable { - let value: Int - let hashValue: Int - - fileprivate init(_ value: Int) { - self.value = value - self.hashValue = value - } - - fileprivate init(_ value: Int, _ hashValue: Int) { - self.value = value - self.hashValue = hashValue - } - - var description: String { - return "\(value) [hash = \(hashValue)]" - } - - func hash(into hasher: inout Hasher) { - hasher.combine(hashValue) - } - - static func == (lhs: CollidableInt, rhs: CollidableInt) -> Bool { - if lhs.value == rhs.value { - precondition(lhs.hashValue == rhs.hashValue) - return true - } - return false - } -} - final class BitmapSmokeTests: CollectionTestCase { func test_BitPartitionSize_isValid() { expectTrue(bitPartitionSize > 0) diff --git a/Tests/CapsuleTests/CollidableInt.swift b/Tests/CapsuleTests/CollidableInt.swift new file mode 100644 index 00000000..066b5725 --- /dev/null +++ b/Tests/CapsuleTests/CollidableInt.swift @@ -0,0 +1,41 @@ +//===----------------------------------------------------------------------===// +// +// This source file is part of the Swift Collections open source project +// +// Copyright (c) 2021 Apple Inc. and the Swift project authors +// Licensed under Apache License v2.0 with Runtime Library Exception +// +// See https://swift.org/LICENSE.txt for license information +// +//===----------------------------------------------------------------------===// + +final class CollidableInt: CustomStringConvertible, Equatable, Hashable { + let value: Int + let hashValue: Int + + init(_ value: Int) { + self.value = value + self.hashValue = value + } + + init(_ value: Int, _ hashValue: Int) { + self.value = value + self.hashValue = hashValue + } + + var description: String { + return "\(value) [hash = \(hashValue)]" + } + + func hash(into hasher: inout Hasher) { + hasher.combine(hashValue) + } + + static func == (lhs: CollidableInt, rhs: CollidableInt) -> Bool { + if lhs.value == rhs.value { + precondition(lhs.hashValue == rhs.hashValue) + return true + } + return false + } +}