From b8a540506a3020f439c3ca5debab37fe97dcfc47 Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Tue, 12 Nov 2024 10:18:35 -0500 Subject: [PATCH] fix --- .../PreviewTraitsTests.swift | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/Tests/DependenciesTests/PreviewTraitsTests.swift b/Tests/DependenciesTests/PreviewTraitsTests.swift index f78f02fd..3e9692a0 100644 --- a/Tests/DependenciesTests/PreviewTraitsTests.swift +++ b/Tests/DependenciesTests/PreviewTraitsTests.swift @@ -1,21 +1,21 @@ -#if os(iOS) || os(macOS) || os(tvOS) || os(watchOS) -import Dependencies -import Testing -import SwiftUI +#if canImport(Testing) && (os(iOS) || os(macOS) || os(tvOS) || os(watchOS)) + import Dependencies + import Testing + import SwiftUI -@Suite -@MainActor -struct PreviewTraitsTests { - @Test - @available(iOS 18, macOS 15, tvOS 18, watchOS 11, visionOS 2, *) - func dependency() { - _ = PreviewTrait.dependency(\.date.now, Date(timeIntervalSince1970: 1234567890)) - withDependencies { - $0.context = .preview - } operation: { - @Dependency(\.date.now) var now - #expect(now == Date(timeIntervalSince1970: 1234567890)) + @Suite + @MainActor + struct PreviewTraitsTests { + @Test + @available(iOS 18, macOS 15, tvOS 18, watchOS 11, visionOS 2, *) + func dependency() { + _ = PreviewTrait.dependency(\.date.now, Date(timeIntervalSince1970: 1_234_567_890)) + withDependencies { + $0.context = .preview + } operation: { + @Dependency(\.date.now) var now + #expect(now == Date(timeIntervalSince1970: 1_234_567_890)) + } } } -} #endif