[Enhancement] Optional+Nil extension #17

Merged
javier merged 3 commits from enhancement/optional_nil into main 2023-05-06 21:19:40 +00:00
2 changed files with 35 additions and 1 deletions
Showing only changes of commit 118dc911ff - Show all commits

View File

@ -4,7 +4,7 @@ public extension TimeZone {
// MARK: Zones // MARK: Zones
/// Greenwich Mean Time or UTC+0 /// A time zone indicating it is Greenwich Mean Time or UTC+0
static let gmt = TimeZone(secondsFromGMT: 0) static let gmt = TimeZone(secondsFromGMT: 0)
} }

View File

@ -0,0 +1,34 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the SwiftLibs open source project
//
// Copyright (c) 2023 Röck+Cöde VoF. and the SwiftLibs project authors
// Licensed under the EUPL 1.2 or later.
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of SwiftLibs project authors
//
//===----------------------------------------------------------------------===//
import Core
import XCTest
final class TimeZone_ZoneTests: XCTestCase {
// MARK: Properties
private var timeZone: TimeZone!
// MARK: Tests
func test_gmt() {
// GIVEN
// WHEN
timeZone = .gmt
// THEN
XCTAssertEqual(timeZone.identifier, "GMT")
XCTAssertEqual(timeZone.secondsFromGMT(), 0)
}
}