Skip to content

Commit 0ffac98

Browse files
committed
Remove imports of Foundation(Essentials|Internationalization|) when TestSupport is imported
TestSupport has `@_exported` imports for those modules.
1 parent 2540344 commit 0ffac98

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1
-320
lines changed

Tests/FoundationEssentialsTests/AttributedString/AttributedStringCOWTests.swift

-6
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@
1414
import TestSupport
1515
#endif
1616

17-
#if FOUNDATION_FRAMEWORK
18-
import Foundation
19-
#else
20-
import FoundationEssentials
21-
#endif
22-
2317
extension AttributedStringProtocol {
2418
fileprivate mutating func genericSetAttribute() {
2519
self.testInt = 3

Tests/FoundationEssentialsTests/AttributedString/AttributedStringTests.swift

-4
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@
1414
import TestSupport
1515
#endif
1616

17-
#if canImport(FoundationEssentials)
18-
import FoundationEssentials
19-
#endif // FOUNDATION_FRAMEWORK
20-
2117
#if FOUNDATION_FRAMEWORK
2218
@_spi(AttributedString) import Foundation
2319
// For testing default attribute scope conversion

Tests/FoundationEssentialsTests/BufferViewTests.swift

-8
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,6 @@
1414
import TestSupport
1515
#endif
1616

17-
#if canImport(FoundationEssentials)
18-
import FoundationEssentials
19-
#endif
20-
21-
#if FOUNDATION_FRAMEWORK
22-
import Foundation
23-
#endif
24-
2517
final class BufferViewTests: XCTestCase {
2618

2719
func testOptionalStorage() {

Tests/FoundationEssentialsTests/DataIOTests.swift

-6
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@ import TestSupport
1818
@preconcurrency import Glibc
1919
#endif
2020

21-
#if FOUNDATION_FRAMEWORK
22-
import Foundation
23-
#else
24-
import FoundationEssentials
25-
#endif // FOUNDATION_FRAMEWORK
26-
2721
class DataIOTests : XCTestCase {
2822

2923
// MARK: - Helpers

Tests/FoundationEssentialsTests/DataTests.swift

-6
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@ import TestSupport
1818
@preconcurrency import Glibc
1919
#endif
2020

21-
#if FOUNDATION_FRAMEWORK
22-
import Foundation
23-
#else
24-
import FoundationEssentials
25-
#endif // FOUNDATION_FRAMEWORK
26-
2721
extension Data {
2822
func withUnsafeUInt8Bytes<R>(_ c: (UnsafePointer<UInt8>) throws -> R) rethrows -> R {
2923
return try self.withUnsafeBytes { (ptr) in

Tests/FoundationEssentialsTests/DateTests.swift

-4
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@
1414
import TestSupport
1515
#endif
1616

17-
#if canImport(FoundationEssentials)
18-
import FoundationEssentials
19-
#endif
20-
2117
final class DateTests : XCTestCase {
2218

2319
func testDateComparison() {

Tests/FoundationEssentialsTests/DecimalTests.swift

+1-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
import TestSupport
1515
#endif // canImport(TestSupport)
1616

17-
#if FOUNDATION_FRAMEWORK
18-
import Foundation
19-
#else
17+
#if canImport(FoundationEssentials)
2018
@_spi(SwiftCorelibsFoundation)
2119
import FoundationEssentials
2220
#endif

Tests/FoundationEssentialsTests/ErrorTests.swift

-4
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@
1414
import TestSupport
1515
#endif
1616

17-
#if canImport(FoundationEssentials)
18-
import FoundationEssentials
19-
#endif
20-
2117
final class ErrorTests : XCTestCase {
2218
func thisThrows() throws {
2319
throw CocoaError(CocoaError.Code(rawValue: 42), userInfo: ["hi" : "there"])

Tests/FoundationEssentialsTests/FileManager/FileManagerPlayground.swift

-6
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@
1414
import TestSupport
1515
#endif
1616

17-
#if FOUNDATION_FRAMEWORK
18-
import Foundation
19-
#else
20-
import FoundationEssentials
21-
#endif
22-
2317
private protocol Buildable {
2418
func build(in path: String, using fileManager: FileManager) throws
2519
}

Tests/FoundationEssentialsTests/FileManager/FileManagerTests.swift

-8
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,6 @@
1515
import TestSupport
1616
#endif // canImport(TestSupport)
1717

18-
#if canImport(FoundationEssentials)
19-
import FoundationEssentials
20-
#endif
21-
22-
#if FOUNDATION_FRAMEWORK
23-
import Foundation
24-
#endif
25-
2618
#if canImport(Android)
2719
@preconcurrency import Android
2820
#endif

Tests/FoundationEssentialsTests/Formatting/ISO8601FormatStyleFormattingTests.swift

-8
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,6 @@
1414
import TestSupport
1515
#endif
1616

17-
#if canImport(FoundationEssentials)
18-
import FoundationEssentials
19-
#endif
20-
21-
#if FOUNDATION_FRAMEWORK
22-
import Foundation
23-
#endif
24-
2517
final class ISO8601FormatStyleFormattingTests: XCTestCase {
2618

2719
func test_ISO8601Format() throws {

Tests/FoundationEssentialsTests/GregorianCalendarRecurrenceRuleTests.swift

-6
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@
1414
import TestSupport
1515
#endif
1616

17-
#if FOUNDATION_FRAMEWORK
18-
import Foundation
19-
#else
20-
import FoundationEssentials
21-
#endif // FOUNDATION_FRAMEWORK
22-
2317
final class GregorianCalendarRecurrenceRuleTests: XCTestCase {
2418
/// A Gregorian calendar in GMT with no time zone changes
2519
var gregorian: Calendar = {

Tests/FoundationEssentialsTests/GregorianCalendarTests.swift

-8
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,6 @@
1414
import TestSupport
1515
#endif
1616

17-
#if canImport(FoundationEssentials)
18-
import FoundationEssentials
19-
#endif
20-
21-
#if FOUNDATION_FRAMEWORK
22-
import Foundation
23-
#endif
24-
2517
// Tests for _GregorianCalendar
2618
final class GregorianCalendarTests : XCTestCase {
2719

Tests/FoundationEssentialsTests/IndexPathTests.swift

-4
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@
1111
import TestSupport
1212
#endif
1313

14-
#if canImport(FoundationEssentials)
15-
import FoundationEssentials
16-
#endif
17-
1814
class TestIndexPath: XCTestCase {
1915
func testEmpty() {
2016
let ip = IndexPath()

Tests/FoundationEssentialsTests/JSONEncoderTests.swift

-4
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ import TestSupport
2525
import FoundationEssentials
2626
#endif
2727

28-
#if FOUNDATION_FRAMEWORK
29-
import Foundation
30-
#endif
31-
3228
// MARK: - Test Suite
3329

3430
final class JSONEncoderTests : XCTestCase {

Tests/FoundationEssentialsTests/LockedStateTests.swift

-6
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@
1414
import TestSupport
1515
#endif
1616

17-
#if FOUNDATION_FRAMEWORK
18-
import Foundation
19-
#else
20-
import FoundationEssentials
21-
#endif
22-
2317
final class LockedStateTests : XCTestCase {
2418
final class TestObject {
2519
var deinitBlock: () -> Void = {}

Tests/FoundationEssentialsTests/ProcessInfoTests.swift

-6
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@
1414
import TestSupport
1515
#endif
1616

17-
#if canImport(FoundationEssentials)
18-
import FoundationEssentials
19-
#else
20-
import Foundation
21-
#endif
22-
2317
#if canImport(Darwin)
2418
import Darwin
2519
#elseif canImport(Glibc)

Tests/FoundationEssentialsTests/PropertyListEncoderTests.swift

-6
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,6 @@
1111
import TestSupport
1212
#endif
1313

14-
#if FOUNDATION_FRAMEWORK
15-
import Foundation
16-
#elseif canImport(FoundationEssentials)
17-
import FoundationEssentials
18-
#endif
19-
2014
// MARK: - Test Suite
2115

2216
class TestPropertyListEncoder : XCTestCase {

Tests/FoundationEssentialsTests/ResourceUtilities.swift

-6
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@ import TestSupport
1919
@preconcurrency import Glibc
2020
#endif
2121

22-
#if FOUNDATION_FRAMEWORK
23-
import Foundation
24-
#else
25-
import FoundationEssentials
26-
#endif // FOUNDATION_FRAMEWORK
27-
2822
#if FOUNDATION_FRAMEWORK
2923
// Always compiled into the Tests project
3024
final internal class Canary { }

Tests/FoundationEssentialsTests/SortComparatorTests.swift

-6
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@
1414
import TestSupport
1515
#endif
1616

17-
#if FOUNDATION_FRAMEWORK
18-
import Foundation
19-
#else
20-
import FoundationEssentials
21-
#endif // FOUNDATION_FRAMEWORK
22-
2317
class SortComparatorTests: XCTestCase {
2418
func test_comparable_descriptors() {
2519
let intDesc: ComparableComparator<Int> = ComparableComparator<Int>()

Tests/FoundationEssentialsTests/StringTests.swift

-6
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
#if FOUNDATION_FRAMEWORK
14-
import Foundation
15-
#else
16-
import FoundationEssentials
17-
#endif // FOUNDATION_FRAMEWORK
18-
1913
#if canImport(TestSupport)
2014
import TestSupport
2115
#endif

Tests/FoundationEssentialsTests/URLTests.swift

-8
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,6 @@
1515
import TestSupport
1616
#endif // canImport(TestSupport)
1717

18-
#if canImport(FoundationEssentials)
19-
import FoundationEssentials
20-
#endif
21-
22-
#if FOUNDATION_FRAMEWORK
23-
import Foundation
24-
#endif
25-
2618
private func checkBehavior<T: Equatable>(_ result: T, new: T, old: T, file: StaticString = #filePath, line: UInt = #line) {
2719
#if FOUNDATION_FRAMEWORK
2820
if foundation_swift_url_enabled() {

Tests/FoundationInternationalizationTests/CalendarRecurrenceRuleTests.swift

-7
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@
1414
import TestSupport
1515
#endif
1616

17-
#if FOUNDATION_FRAMEWORK
18-
import Foundation
19-
#else
20-
import FoundationInternationalization
21-
import FoundationEssentials
22-
#endif // FOUNDATION_FRAMEWORK
23-
2417
final class CalendarRecurrenceRuleTests: XCTestCase {
2518
/// A Gregorian calendar with a time zone set to California
2619
var gregorian: Calendar = {

Tests/FoundationInternationalizationTests/CalendarTests.swift

-7
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@
1414
import TestSupport
1515
#endif
1616

17-
#if FOUNDATION_FRAMEWORK
18-
import Foundation
19-
#else
20-
import FoundationInternationalization
21-
import FoundationEssentials
22-
#endif // FOUNDATION_FRAMEWORK
23-
2417
extension DateComponents {
2518
fileprivate static func differenceBetween(_ d1: DateComponents?, _ d2: DateComponents?, compareQuarter: Bool, within nanosecondAccuracy: Int = 5000) -> String? {
2619
let components: [Calendar.Component] = [.era, .year, .month, .day, .dayOfYear, .hour, .minute, .second, .weekday, .weekdayOrdinal, .weekOfYear, .yearForWeekOfYear, .weekOfMonth, .timeZone, .isLeapMonth, .calendar, .quarter, .nanosecond]

Tests/FoundationInternationalizationTests/DurationExtensionTests.swift

-9
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,6 @@
1414
import TestSupport
1515
#endif
1616

17-
#if canImport(FoundationInternationalization)
18-
import FoundationEssentials
19-
import FoundationInternationalization
20-
#endif
21-
22-
#if FOUNDATION_FRAMEWORK
23-
import Foundation
24-
#endif
25-
2617
final class DurationExtensionTests : XCTestCase {
2718

2819
func testRoundingMode() {

Tests/FoundationInternationalizationTests/Formatting/DateFormatStyleTests.swift

-8
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,6 @@
1414
import TestSupport
1515
#endif
1616

17-
#if canImport(FoundationEssentials)
18-
import FoundationEssentials
19-
import FoundationInternationalization
20-
#endif
21-
22-
#if FOUNDATION_FRAMEWORK
23-
import Foundation
24-
#endif
2517

2618
final class DateFormatStyleTests : XCTestCase {
2719
let referenceDate = Date(timeIntervalSinceReferenceDate: 0)

Tests/FoundationInternationalizationTests/Formatting/DateIntervalFormatStyleTests.swift

-9
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,6 @@
1414
import TestSupport
1515
#endif
1616

17-
#if canImport(FoundationInternationalization)
18-
import FoundationEssentials
19-
import FoundationInternationalization
20-
#endif
21-
22-
#if FOUNDATION_FRAMEWORK
23-
import Foundation
24-
#endif
25-
2617
final class DateIntervalFormatStyleTests: XCTestCase {
2718

2819
let minute: TimeInterval = 60

Tests/FoundationInternationalizationTests/Formatting/DateRelativeFormatStyleTests.swift

-9
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,6 @@
1414
import TestSupport
1515
#endif
1616

17-
#if canImport(FoundationInternationalization)
18-
import FoundationEssentials
19-
import FoundationInternationalization
20-
#endif
21-
22-
#if FOUNDATION_FRAMEWORK
23-
import Foundation
24-
#endif
25-
2617
final class DateRelativeFormatStyleTests: XCTestCase {
2718

2819
let oneHour: TimeInterval = 60 * 60

Tests/FoundationInternationalizationTests/Formatting/DiscreteFormatStyleTestUtilities.swift

-8
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,6 @@
1414
import TestSupport
1515
#endif
1616

17-
#if canImport(FoundationEssentials)
18-
import FoundationEssentials
19-
#endif
20-
21-
#if canImport(FoundationInternationalization)
22-
import FoundationInternationalization
23-
#endif
24-
2517
extension DiscreteFormatStyle where FormatInput : Comparable {
2618
/// Produces a sequence that generates all outputs of a discrete format style from a given start to a given end.
2719
func evaluate(from initialInput: FormatInput, to end: FormatInput, _ advance: @escaping (FormatInput, FormatInput) -> FormatInput? = { prev, next in next }) -> LazySequence<DiscreteFormatStyleSequence<Self>> {

0 commit comments

Comments
 (0)