From 73fc858ff22ccd740c2e24efc322c8d173f37595 Mon Sep 17 00:00:00 2001 From: Joseph Wardell Date: Wed, 29 Jan 2025 14:00:36 -0500 Subject: [PATCH] macOS actually has a TimeZone.gmt static var as of macOS 13. No need to reinvent the wheel --- .../Extensions/TimeZone-StaticVariables.swift | 12 -------- .../Extensions/TimeZone-StaticVariables.swift | 30 ------------------- 2 files changed, 42 deletions(-) delete mode 100644 Sources/Ignite/Extensions/TimeZone-StaticVariables.swift delete mode 100644 Tests/IgniteTesting/Extensions/TimeZone-StaticVariables.swift diff --git a/Sources/Ignite/Extensions/TimeZone-StaticVariables.swift b/Sources/Ignite/Extensions/TimeZone-StaticVariables.swift deleted file mode 100644 index 9cd1ac5b..00000000 --- a/Sources/Ignite/Extensions/TimeZone-StaticVariables.swift +++ /dev/null @@ -1,12 +0,0 @@ -// -// TimeZone-StaticVariables.swift -// Ignite -// https://www.github.com/twostraws/Ignite -// See LICENSE for license information. -// - -import Foundation - -extension TimeZone { - static var gmt: TimeZone? { TimeZone(secondsFromGMT: 0) } -} diff --git a/Tests/IgniteTesting/Extensions/TimeZone-StaticVariables.swift b/Tests/IgniteTesting/Extensions/TimeZone-StaticVariables.swift deleted file mode 100644 index bff88e47..00000000 --- a/Tests/IgniteTesting/Extensions/TimeZone-StaticVariables.swift +++ /dev/null @@ -1,30 +0,0 @@ -// -// TimeZone-StaticVariables.swift -// Ignite -// https://www.github.com/twostraws/Ignite -// See LICENSE for license information. -// - -import Testing -import Foundation - -@testable import Ignite - -@Suite("TimeZone-Constants") -@MainActor -struct Test { - - @Test("gmt equals time zone with identifier GMT") func gmt_equals_expected_value() async throws { - let sut = TimeZone.gmt - - #expect(sut == TimeZone(identifier: "GMT")) - } - - @Test("gmt has no offset from GMT") - func gmt_has_zero_gmt_offset() async throws { - let sut = TimeZone.gmt - - #expect(sut?.secondsFromGMT() == 0) - } - -}