From cd0bb12eea810c809f66fd6e34af6b3667bad2ab Mon Sep 17 00:00:00 2001 From: Rob Amos Date: Wed, 17 Jul 2024 14:48:32 +1000 Subject: [PATCH] Fixed missing UserDefaults conditional compilations --- Sources/Vexil/Pole.swift | 4 ++++ Tests/VexilTests/FlagPoleTests.swift | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/Sources/Vexil/Pole.swift b/Sources/Vexil/Pole.swift index e4e868a9..13b50988 100644 --- a/Sources/Vexil/Pole.swift +++ b/Sources/Vexil/Pole.swift @@ -86,9 +86,13 @@ public final class FlagPole: Sendable where RootGroup: FlagContainer /// - `UserDefaults.standard` /// public static var defaultSources: [any FlagValueSource] { +#if !os(Linux) [ FlagValueSourceCoordinator(source: UserDefaults.standard), ] +#else + [] +#endif } diff --git a/Tests/VexilTests/FlagPoleTests.swift b/Tests/VexilTests/FlagPoleTests.swift index d974d076..1ba7eda9 100644 --- a/Tests/VexilTests/FlagPoleTests.swift +++ b/Tests/VexilTests/FlagPoleTests.swift @@ -30,6 +30,9 @@ final class FlagPoleTestCase: XCTestCase { @Suite("Flag Pole") struct FlagPoleTests { + +#if !os(Linux) + @Test("Sets default sources", .tags(.pole)) func setsDefaultSources() throws { let pole = FlagPole(hoist: TestFlags.self) @@ -41,6 +44,16 @@ struct FlagPoleTests { } } +#else + + @Test("Sets default sources", .tags(.pole)) + func setsDefaultSources() throws { + let pole = FlagPole(hoist: TestFlags.self) + #expect(pole._sources.isEmpty) + } + +#endif + } // MARK: - Fixtures