Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrandonw committed Nov 12, 2024
1 parent 65b0503 commit b8a5405
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions Tests/DependenciesTests/PreviewTraitsTests.swift
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit b8a5405

Please sign in to comment.