File tree 2 files changed +38
-1
lines changed
Tests/AWSLambdaRuntimeCoreTests
2 files changed +38
-1
lines changed Original file line number Diff line number Diff line change
1
+ //===----------------------------------------------------------------------===//
2
+ //
3
+ // This source file is part of the SwiftAWSLambdaRuntime open source project
4
+ //
5
+ // Copyright (c) 2022 Apple Inc. and the SwiftAWSLambdaRuntime project authors
6
+ // Licensed under Apache License v2.0
7
+ //
8
+ // See LICENSE.txt for license information
9
+ // See CONTRIBUTORS.txt for the list of SwiftAWSLambdaRuntime project authors
10
+ //
11
+ // SPDX-License-Identifier: Apache-2.0
12
+ //
13
+ //===----------------------------------------------------------------------===//
14
+
15
+ @testable import AWSLambdaRuntimeCore
16
+ import NIOHTTP1
17
+ import XCTest
18
+
19
+ class InvocationTest : XCTestCase {
20
+ func testInvocationTraceID( ) throws {
21
+ let headers = HTTPHeaders ( [
22
+ ( AmazonHeaders . requestID, " test " ) ,
23
+ ( AmazonHeaders . deadline, String ( Date ( timeIntervalSinceNow: 60 ) . millisSinceEpoch) ) ,
24
+ ( AmazonHeaders . invokedFunctionARN, " arn:aws:lambda:us-east-1:123456789012:function:custom-runtime " ) ,
25
+ ] )
26
+
27
+ var invocation : Invocation ?
28
+
29
+ XCTAssertNoThrow ( invocation = try Invocation ( headers: headers) )
30
+ XCTAssertNotNil ( invocation)
31
+
32
+ guard !invocation!. traceID. isEmpty else {
33
+ XCTFail ( " Invocation traceID is empty " )
34
+ return
35
+ }
36
+ }
37
+ }
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
19
19
20
20
function replace_acceptable_years() {
21
21
# this needs to replace all acceptable forms with 'YEARS'
22
- sed -e ' s/2017-2018/YEARS/' -e ' s/2017-2020/YEARS/' -e ' s/2017-2021/YEARS/' -e ' s/2020-2021/YEARS/' -e ' s/2019/YEARS/' -e ' s/2020/YEARS/' -e ' s/2021/YEARS/'
22
+ sed -e ' s/2017-2018/YEARS/' -e ' s/2017-2020/YEARS/' -e ' s/2017-2021/YEARS/' -e ' s/2020-2021/YEARS/' -e ' s/2019/YEARS/' -e ' s/2020/YEARS/' -e ' s/2021/YEARS/' -e ' s/2022/YEARS/ '
23
23
}
24
24
25
25
printf " => Checking for unacceptable language... "
You can’t perform that action at this time.
0 commit comments