diff --git a/Sources/AppState/Application/Types/Helper/ApplicationLogger.swift b/Sources/AppState/Application/Types/Helper/ApplicationLogger.swift index 4f739ca..61faf8e 100644 --- a/Sources/AppState/Application/Types/Helper/ApplicationLogger.swift +++ b/Sources/AppState/Application/Types/Helper/ApplicationLogger.swift @@ -1,7 +1,7 @@ #if os(Linux) || os(Windows) open class ApplicationLogger { - open func log( - debug message: String, + open func debug( + _ message: String, fileID: StaticString, function: StaticString, line: Int, @@ -16,8 +16,8 @@ open class ApplicationLogger { ) } - open func log( - debug message: () -> String, + open func debug( + _ message: () -> String, fileID: StaticString, function: StaticString, line: Int, @@ -32,8 +32,8 @@ open class ApplicationLogger { ) } - open func log( - error: Error, + open func error( + _ error: Error, message: String, fileID: StaticString, function: StaticString, diff --git a/Tests/AppStateTests/AppStateTests.swift b/Tests/AppStateTests/AppStateTests.swift index 306aad6..6608698 100644 --- a/Tests/AppStateTests/AppStateTests.swift +++ b/Tests/AppStateTests/AppStateTests.swift @@ -19,7 +19,7 @@ fileprivate extension Application { } } -fileprivate class ExampleViewModel: ObservableObject { +fileprivate class ExampleViewModel { @AppState(\.username) var username func testPropertyWrapper() { @@ -27,6 +27,10 @@ fileprivate class ExampleViewModel: ObservableObject { } } +#if !os(Linux) && !os(Windows) +extension ExampleViewModel: ObservableObject { } +#endif + fileprivate struct ExampleView { @AppState(\.username) var username @AppState(\.isLoading) var isLoading diff --git a/Tests/AppStateTests/OptionalSliceTests.swift b/Tests/AppStateTests/OptionalSliceTests.swift index b1cf048..c545613 100644 --- a/Tests/AppStateTests/OptionalSliceTests.swift +++ b/Tests/AppStateTests/OptionalSliceTests.swift @@ -23,7 +23,7 @@ fileprivate extension Application { } } -fileprivate class ExampleViewModel: ObservableObject { +fileprivate class ExampleViewModel { @OptionalSlice(\.exampleValue, \.username) var username @OptionalConstant(\.exampleValue, \.value) var value @OptionalSlice(\.exampleValue, \.isLoading) var isLoading @@ -33,6 +33,10 @@ fileprivate class ExampleViewModel: ObservableObject { } } +#if !os(Linux) && !os(Windows) +extension ExampleViewModel: ObservableObject { } +#endif + fileprivate struct ExampleView { @OptionalSlice(\.exampleValue, \.username) var username @OptionalSlice(\.exampleValue, \.isLoading) var isLoading diff --git a/Tests/AppStateTests/SecureStateTests.swift b/Tests/AppStateTests/SecureStateTests.swift index 08855fb..b0fb849 100644 --- a/Tests/AppStateTests/SecureStateTests.swift +++ b/Tests/AppStateTests/SecureStateTests.swift @@ -1,7 +1,5 @@ -import Foundation #if !os(Linux) && !os(Windows) import SwiftUI -#endif import XCTest @testable import AppState @@ -20,9 +18,7 @@ fileprivate class ExampleSecureViewModel: ObservableObject { func testPropertyWrapper() { token = "QWERTY" - #if !os(Linux) && !os(Windows) _ = Picker("Picker", selection: $token, content: EmptyView.init) - #endif } } @@ -75,3 +71,4 @@ final class SecureStateTests: XCTestCase { XCTAssertNil(viewModel.token) } } +#endif diff --git a/Tests/AppStateTests/SliceTests.swift b/Tests/AppStateTests/SliceTests.swift index cc71b44..6a85ed1 100644 --- a/Tests/AppStateTests/SliceTests.swift +++ b/Tests/AppStateTests/SliceTests.swift @@ -25,7 +25,7 @@ fileprivate extension Application { } } -fileprivate class ExampleViewModel: ObservableObject { +fileprivate class ExampleViewModel { @Slice(\.exampleValue, \.username) var username @Constant(\.exampleValue, \.value) var value @@ -34,6 +34,10 @@ fileprivate class ExampleViewModel: ObservableObject { } } +#if !os(Linux) && !os(Windows) +extension ExampleViewModel: ObservableObject { } +#endif + fileprivate struct ExampleView { @Slice(\.exampleValue, \.username) var username @Slice(\.exampleValue, \.isLoading) var isLoading diff --git a/Tests/AppStateTests/StoredStateTests.swift b/Tests/AppStateTests/StoredStateTests.swift index 9e03434..5e9a80e 100644 --- a/Tests/AppStateTests/StoredStateTests.swift +++ b/Tests/AppStateTests/StoredStateTests.swift @@ -15,7 +15,7 @@ fileprivate struct ExampleStoredValue { @StoredState(\.storedValue) var count } -fileprivate class ExampleStoringViewModel: ObservableObject { +fileprivate class ExampleStoringViewModel { @StoredState(\.storedValue) var count func testPropertyWrapper() { @@ -30,6 +30,10 @@ fileprivate class ExampleStoringViewModel: ObservableObject { } } +#if !os(Linux) && !os(Windows) +extension ExampleStoringViewModel: ObservableObject { } +#endif + final class StoredStateTests: XCTestCase { override class func setUp() { Application.logging(isEnabled: true)