Skip to content

Commit 1fb1966

Browse files
committed
Use raw identifiers display names
1 parent 0bb5c09 commit 1fb1966

File tree

4 files changed

+22
-29
lines changed

4 files changed

+22
-29
lines changed

Tests/AsyncMaterializedSequenceTests/AsyncMaterializedSequenceTests.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import AsyncMaterializedSequence
55
struct AsyncMaterializedSequenceTests {
66

77
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
8-
@Test func materialize_produces_next_events_of_values_of_original_element() async throws {
8+
@Test func `Materialize produces next events of values of original element`() async throws {
99
let source = 1...3
1010
let sequence = source.async.materialize().prefix(source.count)
1111

@@ -17,7 +17,7 @@ struct AsyncMaterializedSequenceTests {
1717
}
1818

1919
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
20-
@Test func materialize_produces_completed_event_when_source_sequence_completes() async throws {
20+
@Test func `Materialize produces completed event when source sequence completes`() async throws {
2121
let source = 0..<1
2222
let sequence = source.async.materialize()
2323

@@ -28,7 +28,7 @@ struct AsyncMaterializedSequenceTests {
2828
}
2929

3030
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
31-
@Test func materialize_produces_completed_event_when_source_sequence_is_empty() async throws {
31+
@Test func `Materialize produces completed event when source sequence is empty`() async throws {
3232
let source: [Int] = []
3333
let sequence = source.async.materialize()
3434

@@ -38,7 +38,7 @@ struct AsyncMaterializedSequenceTests {
3838
}
3939

4040
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
41-
@Test func materialize_forwards_termination_from_source_when_iteration_is_finished() async throws {
41+
@Test func `materialize forwards termination from source when iteration is finished`() async throws {
4242
let source = 1...3
4343

4444
var iterator = source.async.materialize().makeAsyncIterator()
@@ -49,7 +49,7 @@ struct AsyncMaterializedSequenceTests {
4949
}
5050

5151
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
52-
@Test func materialize_produces_completed_event_when_source_sequence_throws() async throws {
52+
@Test func `Materialize produces completed event when source sequence throws`() async throws {
5353
let source = AsyncThrowingStream<Int, any Error> { continuation in
5454
continuation.finish(throwing: TestError())
5555
}
@@ -70,7 +70,7 @@ struct AsyncMaterializedSequenceTests {
7070
}
7171

7272
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
73-
@Test func materialize_produces_completed_event_when_source_sequence_is_cancelled() async throws {
73+
@Test func `Materialize produces completed event when source sequence is cancelled`() async throws {
7474
let trigger = AsyncStream.makeStream(of: Void.self, bufferingPolicy: .bufferingNewest(1))
7575
let source = AsyncStream<Int> { continuation in
7676
continuation.yield(0)

Tests/AsyncSwiftlyTests/TestingTaskGroupTests.swift

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ import TestingSupport
1111

1212
struct TestingTaskGroupTests {
1313

14-
@Test("Given tasks are scheduled at the same time, Then all the tasks are executed in order of enqueueing")
15-
func executeTasksInOrderOfEnqueueing() async throws {
14+
@Test func `Given tasks are scheduled at the same time, Then all the tasks are executed in order of enqueueing`() async throws {
1615
let (stream, continuation) = AsyncStream.makeStream(of: Int.self)
1716
let operations = 0..<100
1817

@@ -29,8 +28,7 @@ struct TestingTaskGroupTests {
2928
await #expect(stream.collect() == Array(operations))
3029
}
3130

32-
@Test("Given tasks are scheduled at different times, Then all the tasks are executed in order of scheduling")
33-
func executeTasksInOrderOfScheduling() async throws {
31+
@Test func `Given tasks are scheduled at different times, Then all the tasks are executed in order of scheduling`() async throws {
3432
let (stream, continuation) = AsyncStream.makeStream(of: Int.self)
3533
let source = 0..<100
3634

@@ -47,8 +45,7 @@ struct TestingTaskGroupTests {
4745
await #expect(stream.collect() == Array(source))
4846
}
4947

50-
@Test("Given tasks with large time gaps, Then all the tasks are executed in order of scheduling")
51-
func executeTasksWithLargeTimeGaps() async throws {
48+
@Test func `Given tasks with large time gaps, Then all the tasks are executed in order of scheduling`() async throws {
5249
let (stream, continuation) = AsyncStream.makeStream(of: Int.self)
5350

5451
_ = try await withTestingTaskGroup(observing: Void.self) { group in
@@ -68,8 +65,7 @@ struct TestingTaskGroupTests {
6865
await #expect(stream.collect() == [1, 2, 3])
6966
}
7067

71-
@Test("Given task suspended by dependency, When another task resolves dependency, Then dependent task resumes its work")
72-
func resumeDependentTaskWhenDependencyIsResolved() async throws {
68+
@Test func `Given task suspended by dependency, When another task resolves dependency, Then dependent task resumes its work`() async throws {
7369
let order = AsyncStream.makeStream(of: Int.self)
7470
let dependency = AsyncStream.makeStream(of: Void.self)
7571

@@ -92,8 +88,7 @@ struct TestingTaskGroupTests {
9288
await #expect(order.stream.collect() == [0, 1, 2, 3])
9389
}
9490

95-
@Test("Given task suspended by long running dependency, When group exceeds provided timeout, Then group is cancelled and throws timeout error")
96-
func cancelTaskGroupWhenProvidedTimeoutIsExceeded() async throws {
91+
@Test func `Given task suspended by long running dependency, When group exceeds provided timeout, Then group is cancelled and throws timeout error`() async throws {
9792
await #expect(throws: TimeoutError.self) {
9893
_ = try await withTestingTaskGroup(observing: Void.self, timeout: 1) { group in
9994
group.addTask(at: 0) {
@@ -118,8 +113,7 @@ struct TestingTaskGroupTests {
118113
}
119114
}
120115

121-
@Test("Given observed sequence is finite, When sequence completes, Then observation finishes")
122-
func observationFinishes() async throws {
116+
@Test func `Given observed sequence is finite, When sequence completes, Then observation finishes`() async throws {
123117
let (stream, continuation) = AsyncStream.makeStream(of: Int.self)
124118

125119
let result = try await withTestingTaskGroup { group in
@@ -144,8 +138,7 @@ struct TestingTaskGroupTests {
144138
])
145139
}
146140

147-
@Test("Given observed sequence is infinite, When all tasks complete, Then observation finishes")
148-
func infiniteObservationFinishes() async throws {
141+
@Test func `Given observed sequence is infinite, When all tasks complete, Then observation finishes`() async throws {
149142
let (stream, continuation) = AsyncStream.makeStream(of: Int.self)
150143

151144
let result = try await withTestingTaskGroup { group in

Tests/AsyncTriggerTests/AsyncTriggerTests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import TestingSupport
44

55
struct AsyncTriggerTests {
66

7-
@Test func trigger_resumes_consumers_when_fire_is_called() async throws {
7+
@Test func `Trigger resumes consumers when fire is called`() async throws {
88
let trigger = AsyncTrigger()
99

1010
async let work1 = trigger()
@@ -15,7 +15,7 @@ struct AsyncTriggerTests {
1515
await #expect((work1, work2) == (.triggered, .triggered))
1616
}
1717

18-
@Test func trigger_resumes_consumers_immediately_given_trigger_is_fired() async throws {
18+
@Test func `Trigger resumes consumers immediately given trigger is fired`() async throws {
1919
let trigger = AsyncTrigger()
2020
trigger.fire()
2121

@@ -25,7 +25,7 @@ struct AsyncTriggerTests {
2525
await #expect((work1, work2) == (.triggered, .triggered))
2626
}
2727

28-
@Test func trigger_consumer_resumes_when_task_is_cancelled() async throws {
28+
@Test func `Trigger consumer resumes when task is cancelled`() async throws {
2929
let trigger = AsyncTrigger()
3030
let work = Task(operation: trigger.callAsFunction)
3131

@@ -34,7 +34,7 @@ struct AsyncTriggerTests {
3434
await #expect(work.value == .cancelled)
3535
}
3636

37-
@Test func trigger_is_async_sequence() async throws {
37+
@Test func `Trigger is async sequence`() async throws {
3838
let trigger = AsyncTrigger()
3939

4040
async let work = trigger.collect()

Tests/TestingSupportTests/AsyncSequence+CollectTests.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ struct AsyncSequenceCollectTests {
88
[1],
99
[1, 2, 3]
1010
])
11-
func collect_produces_array_of_elements_of_source_sequence(source: [Int]) async throws {
11+
func `Collect produces array of elements of source sequence`(source: [Int]) async throws {
1212
let sequence = source.async
1313
let expectedResult = Array(source)
1414

1515
await #expect(sequence.collect() == expectedResult)
1616
}
1717

18-
@Test func collect_produces_empty_array_when_source_sequence_is_completed_without_elements() async throws {
18+
@Test func `Collect produces empty array when source sequence is completed without elements`() async throws {
1919
let stream = AsyncStream<Int> { $0.finish() }
2020
await #expect(stream.collect()?.isEmpty == true)
2121
}
2222

23-
@Test func collect_produces_nil_when_source_sequence_is_cancelled() async throws {
23+
@Test func `Collect produces nil when source sequence is cancelled`() async throws {
2424
let task = Task {
2525
let stream = AsyncStream<Int> { _ in }
2626
return await stream.collect()
@@ -31,7 +31,7 @@ struct AsyncSequenceCollectTests {
3131
await #expect(task.value == nil)
3232
}
3333

34-
@Test func collect_produces_array_of_elements_when_source_sequence_is_cancelled_and_produced_some_elements() async throws {
34+
@Test func `Collect produces array of elements when source sequence is cancelled and produced some elements`() async throws {
3535
let source = [1, 2, 3]
3636
let task = Task {
3737
let stream = AsyncStream<Int> {
@@ -47,7 +47,7 @@ struct AsyncSequenceCollectTests {
4747
await #expect(task.value == source)
4848
}
4949

50-
@Test func collect_rethrows_error_when_source_sequence_is_failed() async throws {
50+
@Test func `Collect rethrows error when source sequence is failed`() async throws {
5151
let stream = AsyncThrowingStream {
5252
throw TestError()
5353
}

0 commit comments

Comments
 (0)