Skip to content

Commit d9d4150

Browse files
committed
Test exit tests
1 parent 204c253 commit d9d4150

File tree

1 file changed

+2
-60
lines changed

1 file changed

+2
-60
lines changed

Tests/FoundationEssentialsTests/AttributedString/AttributedStringIndexTrackingTests.swift

Lines changed: 2 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -175,37 +175,9 @@ private struct AttributedStringIndexTrackingTests {
175175

176176
#if FOUNDATION_EXIT_TESTS
177177
@Test
178-
func trackingLostPreconditions() async {
178+
func testExitTests() async {
179179
await #expect(processExitsWith: .failure) {
180-
var text = AttributedString("Hello, world")
181-
var helloRange = try #require(text.range(of: "Hello"))
182-
text.transform(updating: &helloRange) {
183-
$0 = AttributedString("Foo")
184-
}
185-
}
186-
187-
await #expect(processExitsWith: .failure) {
188-
var text = AttributedString("Hello, world")
189-
var helloRange = try #require(text.range(of: "Hello"))
190-
text.transform(updating: &helloRange) {
191-
$0 = AttributedString("Hello world")
192-
}
193-
}
194-
195-
await #expect(processExitsWith: .failure) {
196-
var text = AttributedString("Hello, world")
197-
var ranges = [try #require(text.range(of: "Hello"))]
198-
text.transform(updating: &ranges) {
199-
$0 = AttributedString("Foo")
200-
}
201-
}
202-
203-
await #expect(processExitsWith: .failure) {
204-
var text = AttributedString("Hello, world")
205-
var ranges = [try #require(text.range(of: "Hello"))]
206-
text.transform(updating: &ranges) {
207-
$0 = AttributedString("Hello world")
208-
}
180+
print("Running the thing!")
209181
}
210182
}
211183
#endif
@@ -262,34 +234,4 @@ private struct AttributedStringIndexTrackingTests {
262234
#expect(AttributedString(text[updatedRanges[0]]) == original[helloRange].settingAttributes(AttributeContainer.testInt(2)))
263235
#expect(AttributedString(text[updatedRanges[1]]) == original[worldRange].settingAttributes(AttributeContainer.testInt(2)))
264236
}
265-
266-
#if FOUNDATION_EXIT_TESTS
267-
@Test
268-
func invalidInputRanges() async {
269-
await #expect(processExitsWith: .failure) {
270-
var text = AttributedString("Hello, world")
271-
let other = text + AttributedString("Extra text")
272-
let range = other.startIndex ..< other.endIndex
273-
_ = text.transform(updating: range) { _ in
274-
275-
}
276-
}
277-
278-
await #expect(processExitsWith: .failure) {
279-
var text = AttributedString("Hello, world")
280-
let other = text + AttributedString("Extra text")
281-
let range = other.endIndex ..< other.endIndex
282-
_ = text.transform(updating: range) { _ in
283-
284-
}
285-
}
286-
287-
await #expect(processExitsWith: .failure) {
288-
var text = AttributedString("Hello, world")
289-
_ = text.transform(updating: []) { _ in
290-
291-
}
292-
}
293-
}
294-
#endif
295237
}

0 commit comments

Comments
 (0)