Skip to content

Commit dede067

Browse files
authored
[tests] minor changes, mostly syntaxic (#530)
tiny syntax changes in the test suite
1 parent 4a7d95e commit dede067

File tree

4 files changed

+22
-22
lines changed

4 files changed

+22
-22
lines changed

Tests/AWSLambdaRuntimeTests/NewLambda+CodableTests.swift renamed to Tests/AWSLambdaRuntimeTests/Lambda+CodableTests.swift

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -77,24 +77,24 @@ struct JSONTests {
7777
let result = await writer.output
7878
#expect(result == ByteBuffer(string: #"{"bar":"baz"}"#))
7979
}
80-
}
8180

82-
final actor MockLambdaWriter: LambdaResponseStreamWriter {
83-
private var _buffer: ByteBuffer?
81+
final actor MockLambdaWriter: LambdaResponseStreamWriter {
82+
private var _buffer: ByteBuffer?
8483

85-
var output: ByteBuffer? {
86-
self._buffer
87-
}
84+
var output: ByteBuffer? {
85+
self._buffer
86+
}
8887

89-
func writeAndFinish(_ buffer: ByteBuffer) async throws {
90-
self._buffer = buffer
91-
}
88+
func writeAndFinish(_ buffer: ByteBuffer) async throws {
89+
self._buffer = buffer
90+
}
9291

93-
func write(_ buffer: ByteBuffer) async throws {
94-
fatalError("Unexpected call")
95-
}
92+
func write(_ buffer: ByteBuffer) async throws {
93+
fatalError("Unexpected call")
94+
}
9695

97-
func finish() async throws {
98-
fatalError("Unexpected call")
96+
func finish() async throws {
97+
fatalError("Unexpected call")
98+
}
9999
}
100100
}

Tests/AWSLambdaRuntimeTests/LambdaRunLoopTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ struct LambdaRunLoopTests {
4848
}
4949
}
5050

51-
let mockClient = LambdaMockClient()
51+
let mockClient = MockLambdaClient()
5252
let mockEchoHandler = MockEchoHandler()
5353
let failingHandler = FailingHandler()
5454

Tests/AWSLambdaRuntimeTests/LambdaRuntimeTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ struct LambdaRuntimeTests {
5050
}
5151

5252
// wait a small amount to ensure runtime1 task is started
53-
try await Task.sleep(for: .seconds(1))
53+
try await Task.sleep(for: .seconds(0.5))
5454

5555
// Running the second runtime should trigger LambdaRuntimeError
5656
await #expect(throws: LambdaRuntimeError.self) {
@@ -71,7 +71,7 @@ struct LambdaRuntimeTests {
7171
}
7272

7373
// Set timeout and cancel the runtime 2
74-
try await Task.sleep(for: .seconds(2))
74+
try await Task.sleep(for: .seconds(1))
7575
taskGroup.cancelAll()
7676
}
7777
}

Tests/AWSLambdaRuntimeTests/LambdaMockClient.swift renamed to Tests/AWSLambdaRuntimeTests/MockLambdaClient.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ import FoundationEssentials
2222
import Foundation
2323
#endif
2424

25-
struct LambdaMockWriter: LambdaRuntimeClientResponseStreamWriter {
26-
var underlying: LambdaMockClient
25+
struct MockLambdaWriter: LambdaRuntimeClientResponseStreamWriter {
26+
var underlying: MockLambdaClient
2727

28-
init(underlying: LambdaMockClient) {
28+
init(underlying: MockLambdaClient) {
2929
self.underlying = underlying
3030
}
3131

@@ -55,8 +55,8 @@ enum LambdaError: Error, Equatable {
5555
case handlerError
5656
}
5757

58-
final actor LambdaMockClient: LambdaRuntimeClientProtocol {
59-
typealias Writer = LambdaMockWriter
58+
final actor MockLambdaClient: LambdaRuntimeClientProtocol {
59+
typealias Writer = MockLambdaWriter
6060

6161
private struct StateMachine {
6262
private enum State {

0 commit comments

Comments
 (0)