Skip to content

Commit bc5d958

Browse files
committed
formatting
1 parent 561d37b commit bc5d958

File tree

3 files changed

+31
-16
lines changed

3 files changed

+31
-16
lines changed

Sources/AWSLambdaEvents/Utils/RFC5322DateParseStrategy.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,4 +263,4 @@ let timezoneOffsetMap: [[UInt8]: Int] = [
263263
Array("CDT".utf8): -5 * 60,
264264
Array("MDT".utf8): -6 * 60,
265265
Array("PDT".utf8): -7 * 60,
266-
]
266+
]
Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import XCTest
2+
23
@testable import AWSLambdaEvents
34

45
final class IteratorProtocolTests: XCTestCase {
@@ -7,61 +8,61 @@ final class IteratorProtocolTests: XCTestCase {
78
var iterator = "abc".utf8.makeIterator()
89
XCTAssertTrue(iterator.expect(UInt8(ascii: "a")))
910
XCTAssertEqual(iterator.next(), UInt8(ascii: "b"))
10-
11+
1112
// Test non-matching character
1213
iterator = "abc".utf8.makeIterator()
1314
XCTAssertFalse(iterator.expect(UInt8(ascii: "x")))
1415
}
15-
16+
1617
func testNextSkippingWhitespace() {
1718
// Test with leading spaces
1819
var iterator = " abc".utf8.makeIterator()
1920
XCTAssertEqual(iterator.nextSkippingWhitespace(), UInt8(ascii: "a"))
20-
21+
2122
// Test with no spaces
2223
iterator = "abc".utf8.makeIterator()
2324
XCTAssertEqual(iterator.nextSkippingWhitespace(), UInt8(ascii: "a"))
24-
25+
2526
// Test with only spaces
2627
iterator = " ".utf8.makeIterator()
2728
XCTAssertNil(iterator.nextSkippingWhitespace())
2829
}
29-
30+
3031
func testNextAsciiDigit() {
3132
// Test basic digit
3233
var iterator = "123".utf8.makeIterator()
3334
XCTAssertEqual(iterator.nextAsciiDigit(), UInt8(ascii: "1"))
34-
35+
3536
// Test with leading spaces and skipping whitespace
3637
iterator = " 123".utf8.makeIterator()
3738
XCTAssertEqual(iterator.nextAsciiDigit(skippingWhitespace: true), UInt8(ascii: "1"))
38-
39+
3940
// Test with leading spaces and not skipping whitespace
4041
iterator = " 123".utf8.makeIterator()
4142
XCTAssertNil(iterator.nextAsciiDigit())
42-
43+
4344
// Test with non-digit
4445
iterator = "abc".utf8.makeIterator()
4546
XCTAssertNil(iterator.nextAsciiDigit())
4647
}
47-
48+
4849
func testNextAsciiLetter() {
4950
// Test basic letter
5051
var iterator = "abc".utf8.makeIterator()
5152
XCTAssertEqual(iterator.nextAsciiLetter(), UInt8(ascii: "a"))
52-
53+
5354
// Test with leading spaces and skipping whitespace
5455
iterator = " abc".utf8.makeIterator()
5556
XCTAssertEqual(iterator.nextAsciiLetter(skippingWhitespace: true), UInt8(ascii: "a"))
56-
57+
5758
// Test with leading spaces and not skipping whitespace
5859
iterator = " abc".utf8.makeIterator()
5960
XCTAssertNil(iterator.nextAsciiLetter())
60-
61+
6162
// Test with non-letter
6263
iterator = "123".utf8.makeIterator()
6364
XCTAssertNil(iterator.nextAsciiLetter())
64-
65+
6566
// Test with uppercase
6667
iterator = "ABC".utf8.makeIterator()
6768
XCTAssertEqual(iterator.nextAsciiLetter(), UInt8(ascii: "A"))
@@ -70,4 +71,4 @@ final class IteratorProtocolTests: XCTestCase {
7071
iterator = "".utf8.makeIterator()
7172
XCTAssertNil(iterator.nextAsciiLetter())
7273
}
73-
}
74+
}

Tests/AWSLambdaEventsTests/Utils/RFC5322DateParseStrategyTests.swift

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// This source file is part of the SwiftAWSLambdaRuntime open source project
4+
//
5+
// Copyright (c) 2017-2020 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+
115
import XCTest
216

317
@testable import AWSLambdaEvents
@@ -93,4 +107,4 @@ class RFC5322DateParseStrategyTests: XCTestCase {
93107
let input = "Fri, 26 Jun 2020 03:04:03 -05CDT (CDT)"
94108
XCTAssertThrowsError(try Date(input, strategy: RFC5322DateParseStrategy()))
95109
}
96-
}
110+
}

0 commit comments

Comments
 (0)