Skip to content

Commit 6abc848

Browse files
committed
Update Set<AnyHashable> test case that no longer crashes
1 parent 2668b52 commit 6abc848

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

validation-test/stdlib/SetAnyHashableExtensions.swift

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,7 @@ SetTests.test("insert<Hashable>(_:)") {
126126
expectEqual(expected, s)
127127
}
128128

129-
SetTests.test("insert<Hashable>(_:)/CastTrap")
130-
.crashOutputMatches("Could not cast value of type 'main.TestHashableDerivedA'")
131-
.crashOutputMatches("to 'main.TestHashableDerivedB'")
132-
.code {
129+
SetTests.test("insert<Hashable>(_:)/FormerCastTrap") {
133130
var s: Set<AnyHashable> = [
134131
AnyHashable(TestHashableDerivedA(1010, identity: 1)),
135132
]
@@ -141,7 +138,6 @@ SetTests.test("insert<Hashable>(_:)/CastTrap")
141138
expectEqual(1, memberAfterInsert.identity)
142139
}
143140

144-
expectCrashLater()
145141
_ = s.insert(TestHashableDerivedB(1010, identity: 3))
146142
}
147143

@@ -181,10 +177,7 @@ SetTests.test("update<Hashable>(with:)") {
181177
expectEqual(expected, s)
182178
}
183179

184-
SetTests.test("update<Hashable>(with:)/CastTrap")
185-
.crashOutputMatches("Could not cast value of type 'main.TestHashableDerivedA'")
186-
.crashOutputMatches("to 'main.TestHashableDerivedB'")
187-
.code {
180+
SetTests.test("update<Hashable>(with:)/FormerCastTrap") {
188181
var s: Set<AnyHashable> = [
189182
AnyHashable(TestHashableDerivedA(1010, identity: 1)),
190183
]
@@ -194,7 +187,6 @@ SetTests.test("update<Hashable>(with:)/CastTrap")
194187
expectEqual(1, old.identity)
195188
}
196189

197-
expectCrashLater()
198190
s.update(with: TestHashableDerivedB(1010, identity: 3))
199191
}
200192

@@ -228,10 +220,7 @@ SetTests.test("remove<Hashable>(_:)") {
228220
}
229221
}
230222

231-
SetTests.test("remove<Hashable>(_:)/CastTrap")
232-
.crashOutputMatches("Could not cast value of type 'main.TestHashableDerivedA'")
233-
.crashOutputMatches("to 'main.TestHashableDerivedB'")
234-
.code {
223+
SetTests.test("remove<Hashable>(_:)/FormerCastTrap") {
235224
var s: Set<AnyHashable> = [
236225
AnyHashable(TestHashableDerivedA(1010, identity: 1)),
237226
AnyHashable(TestHashableDerivedA(2020, identity: 1)),
@@ -243,7 +232,6 @@ SetTests.test("remove<Hashable>(_:)/CastTrap")
243232
expectEqual(1, old.identity)
244233
}
245234

246-
expectCrashLater()
247235
s.remove(TestHashableDerivedB(2020, identity: 2))
248236
}
249237

0 commit comments

Comments
 (0)