Skip to content

Commit

Permalink
Remove fatalError check
Browse files Browse the repository at this point in the history
  • Loading branch information
dmkskn committed Nov 13, 2022
1 parent ddd2d63 commit 42bc484
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 82 deletions.
61 changes: 0 additions & 61 deletions Sources/PlatformSpecificValue/FatalErrorUtility.swift

This file was deleted.

21 changes: 0 additions & 21 deletions Tests/PlatformSpecificValueTests/PlatformSpecificValueTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import XCTest
@testable import PlatformSpecificValue



final class PlatformSpecificValueTests: XCTestCase {
func testThatPlatformSpecificFunctionReturnsTheRightValue() throws {
let value: String = platformSpecific([.macOS("macOS"), .iOS("iOS"), .watchOS("watchOS"), .tvOS("tvOS")])
Expand All @@ -19,24 +18,4 @@ final class PlatformSpecificValueTests: XCTestCase {
#error("Testing on an unsupported platform")
#endif
}

func testThatPlatformSpecificFunctionThrowsFatalErrorIfThereIsNoAppropriateValue() throws {
let values: Set<PlatformSpecificValue<String>> = [.macOS("macOS"), .iOS("iOS"), .watchOS("watchOS"), .tvOS("tvOS")]

XCTestFatalError("No value was provided.") {
#if os(macOS)
let filteredValues = values.filter { $0 != .macOS("macOS") }
#elseif os(iOS)
let filteredValues = values.filter { $0 != .iOS("iOS") }
#elseif os(watchOS)
let filteredValues = values.filter { $0 != .watchOS("watchOS") }
#elseif os(tvOS)
let filteredValues = values.filter { $0 != .tvOS("tvOS") }
#else
#error("Testing on an unsupported platform")
#endif
_ = platformSpecific(filteredValues)
}
}
}

0 comments on commit 42bc484

Please sign in to comment.