From ea54b46971bf882b6a3957939056dd103d9185fc Mon Sep 17 00:00:00 2001 From: Stephen Celis Date: Tue, 7 May 2024 12:41:08 -0700 Subject: [PATCH 1/9] Add `assert` and `precondition` Lightweight ways of writing assertions and preconditions in a testable fashion. --- .../DependencyValues/Assert.swift | 104 ++++++++++++++++++ Tests/DependenciesTests/AssertTests.swift | 34 ++++++ 2 files changed, 138 insertions(+) create mode 100644 Sources/Dependencies/DependencyValues/Assert.swift create mode 100644 Tests/DependenciesTests/AssertTests.swift diff --git a/Sources/Dependencies/DependencyValues/Assert.swift b/Sources/Dependencies/DependencyValues/Assert.swift new file mode 100644 index 00000000..234dc2fc --- /dev/null +++ b/Sources/Dependencies/DependencyValues/Assert.swift @@ -0,0 +1,104 @@ +extension DependencyValues { + /// A dependency for handling assertions. + /// + /// Useful as a controllable and testable substitute for Swift's `assert` function that calls + /// `XCTFail` in tests instead of terminating the executable. + /// + /// ```swift + /// func operate(_ n: Int) { + /// @Dependency(\.assert) var assert + /// assert(n > 0, "Number must be greater than zero") + /// // ... + /// } + /// ``` + /// + /// Tests can assert against this precondition using `XCTExpectFailure`: + /// + /// ```swift + /// XCTExpectFailure { + /// operate(n) + /// } issueMatcher: { + /// $0.compactDescription = "Number must be greater than zero" + /// } + /// ``` + public var assert: Assert { + get { self[AssertKey.self] } + set { self[AssertKey.self] = newValue } + } + + /// A dependency for handling preconditions. + /// + /// Useful as a controllable and testable substitute for Swift's `precondition` function that + /// calls `XCTFail` in tests instead of terminating the executable. + /// + /// ```swift + /// func operate(_ n: Int) { + /// @Dependency(\.precondition) var precondition + /// precondition(n > 0, "Number must be greater than zero") + /// // ... + /// } + /// ``` + /// + /// Tests can assert against this precondition using `XCTExpectFailure`: + /// + /// ```swift + /// XCTExpectFailure { + /// operate(n) + /// } issueMatcher: { + /// $0.compactDescription = "Number must be greater than zero" + /// } + /// ``` + public var precondition: Assert { + get { self[PreconditionKey.self] } + set { self[PreconditionKey.self] = newValue } + }} + +/// A type for creating an assertion or precondition. +/// +/// See ``DependencyValues/assert`` or ``DependencyValues/precondition`` for more information. +public struct Assert: Sendable { + public let assert: @Sendable ( + _ condition: @autoclosure () -> Bool, + _ message: @autoclosure () -> String, + _ file: StaticString, + _ line: UInt + ) -> Void + + public init( + _ assert: @escaping @Sendable ( + _ condition: @autoclosure () -> Bool, + _ message: @autoclosure () -> String, + _ file: StaticString, + _ line: UInt + ) -> Void + ) { + self.assert = assert + } + + public func callAsFunction( + _ condition: @autoclosure () -> Bool, + _ message: @autoclosure () -> String = "", + file: StaticString = #file, + line: UInt = #line + ) { + self.assert(condition(), message(), file, line) + } +} + +private enum AssertKey: DependencyKey { + public static let liveValue = Assert { condition, message, file, line in + Swift.assert(condition(), message(), file: file, line: line) + } + public static let testValue = Assert { condition, message, file, line in + guard condition() else { return XCTFail(message(), file: file, line: line) } + } +} + +private enum PreconditionKey: DependencyKey { + public static let liveValue = Assert { condition, message, file, line in + Swift.precondition(condition(), message(), file: file, line: line) + } + public static let testValue = Assert { condition, message, file, line in + guard condition() else { return XCTFail(message(), file: file, line: line) } + } +} diff --git a/Tests/DependenciesTests/AssertTests.swift b/Tests/DependenciesTests/AssertTests.swift new file mode 100644 index 00000000..b79659d8 --- /dev/null +++ b/Tests/DependenciesTests/AssertTests.swift @@ -0,0 +1,34 @@ +import Dependencies +import XCTest + +final class AssertTests: XCTestCase { + @Dependency(\.assert) var assert + + func testPass() { + assert(true) + assert(true, "Must be true") + } + + func testFail() { + XCTExpectFailure { + assert(false) + } + XCTExpectFailure { + assert(false, "Must be true") + } issueMatcher: { + $0.compactDescription == "Must be true" + } + } + + func testCustom() { + let expectation = self.expectation(description: "assert") + withDependencies { + $0.assert = Assert { condition, message, file, line in + expectation.fulfill() + } + } operation: { + assert(true) + self.wait(for: [expectation], timeout: 0) + } + } +} From 1e9db2eba24d6e833fd692ce8c453da5ccca5ed6 Mon Sep 17 00:00:00 2001 From: Stephen Celis Date: Tue, 7 May 2024 12:42:44 -0700 Subject: [PATCH 2/9] wip --- Tests/DependenciesTests/AssertTests.swift | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Tests/DependenciesTests/AssertTests.swift b/Tests/DependenciesTests/AssertTests.swift index b79659d8..a451aefb 100644 --- a/Tests/DependenciesTests/AssertTests.swift +++ b/Tests/DependenciesTests/AssertTests.swift @@ -3,10 +3,13 @@ import XCTest final class AssertTests: XCTestCase { @Dependency(\.assert) var assert + @Dependency(\.precondition) var precondition func testPass() { assert(true) assert(true, "Must be true") + precondition(true) + precondition(true, "Must be true") } func testFail() { @@ -18,6 +21,14 @@ final class AssertTests: XCTestCase { } issueMatcher: { $0.compactDescription == "Must be true" } + XCTExpectFailure { + precondition(false) + } + XCTExpectFailure { + precondition(false, "Must be true") + } issueMatcher: { + $0.compactDescription == "Must be true" + } } func testCustom() { From d3e3f6cad783203f95e8b2b1a8efbbd1fdafb135 Mon Sep 17 00:00:00 2001 From: Stephen Celis Date: Tue, 7 May 2024 12:49:01 -0700 Subject: [PATCH 3/9] wip --- Tests/DependenciesTests/AssertTests.swift | 36 ++++++++++++----------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/Tests/DependenciesTests/AssertTests.swift b/Tests/DependenciesTests/AssertTests.swift index a451aefb..732acf0e 100644 --- a/Tests/DependenciesTests/AssertTests.swift +++ b/Tests/DependenciesTests/AssertTests.swift @@ -12,24 +12,26 @@ final class AssertTests: XCTestCase { precondition(true, "Must be true") } - func testFail() { - XCTExpectFailure { - assert(false) - } - XCTExpectFailure { - assert(false, "Must be true") - } issueMatcher: { - $0.compactDescription == "Must be true" - } - XCTExpectFailure { - precondition(false) - } - XCTExpectFailure { - precondition(false, "Must be true") - } issueMatcher: { - $0.compactDescription == "Must be true" + #if os(iOS) || os(macOS) || os(tvOS) || os(watchOS) + func testFail() { + XCTExpectFailure { + assert(false) + } + XCTExpectFailure { + assert(false, "Must be true") + } issueMatcher: { + $0.compactDescription == "Must be true" + } + XCTExpectFailure { + precondition(false) + } + XCTExpectFailure { + precondition(false, "Must be true") + } issueMatcher: { + $0.compactDescription == "Must be true" + } } - } + #endif func testCustom() { let expectation = self.expectation(description: "assert") From e091e3dd3252dc2df8cba975292edf5bfa3cc799 Mon Sep 17 00:00:00 2001 From: Stephen Celis Date: Tue, 7 May 2024 13:24:08 -0700 Subject: [PATCH 4/9] wip --- .../DependencyValues/Assert.swift | 149 +++++++++++++++--- .../Extensions/DependencyValues.md | 6 +- .../Extensions/DependencyValuesAssert.md | 12 ++ Tests/DependenciesTests/AssertTests.swift | 2 +- 4 files changed, 141 insertions(+), 28 deletions(-) create mode 100644 Sources/Dependencies/Documentation.docc/Extensions/DependencyValuesAssert.md diff --git a/Sources/Dependencies/DependencyValues/Assert.swift b/Sources/Dependencies/DependencyValues/Assert.swift index 234dc2fc..38f2bfd2 100644 --- a/Sources/Dependencies/DependencyValues/Assert.swift +++ b/Sources/Dependencies/DependencyValues/Assert.swift @@ -21,11 +21,18 @@ extension DependencyValues { /// $0.compactDescription = "Number must be greater than zero" /// } /// ``` - public var assert: Assert { + public var assert: any AssertionEffect { get { self[AssertKey.self] } set { self[AssertKey.self] = newValue } } + /// A dependency for failing an assertion. + /// + /// Equivalent to passing a `false` condition to ``DependencyValues/assert``. + public var assertionFailure: any AssertionFailureEffect { + AssertionFailure(base: self.assert) + } + /// A dependency for handling preconditions. /// /// Useful as a controllable and testable substitute for Swift's `precondition` function that @@ -48,16 +55,124 @@ extension DependencyValues { /// $0.compactDescription = "Number must be greater than zero" /// } /// ``` - public var precondition: Assert { + public var precondition: any AssertionEffect { get { self[PreconditionKey.self] } set { self[PreconditionKey.self] = newValue } - }} + } + + /// A dependency for failing a precondition. + /// + /// Equivalent to passing a `false` condition to ``DependencyValues/precondition``. + public var preconditionFailure: any AssertionFailureEffect { + AssertionFailure(base: self.assert) + } +} /// A type for creating an assertion or precondition. /// /// See ``DependencyValues/assert`` or ``DependencyValues/precondition`` for more information. -public struct Assert: Sendable { - public let assert: @Sendable ( +public protocol AssertionEffect: Sendable { + func callAsFunction( + _ condition: @autoclosure () -> Bool, + _ message: @autoclosure () -> String, + file: StaticString, + line: UInt + ) +} + +extension AssertionEffect { + @_transparent + public func callAsFunction( + _ condition: @autoclosure () -> Bool, + _ message: @autoclosure () -> String = "", + file: StaticString = #file, + line: UInt = #line + ) { + self.callAsFunction(condition(), "", file: file, line: line) + } +} + +private struct LiveAssertionEffect: AssertionEffect { + @_transparent + func callAsFunction( + _ condition: @autoclosure () -> Bool, + _ message: @autoclosure () -> String, + file: StaticString, + line: UInt + ) { + Swift.assert(condition(), message(), file: file, line: line) + } +} + +private struct LivePreconditionEffect: AssertionEffect { + @_transparent + func callAsFunction( + _ condition: @autoclosure () -> Bool, + _ message: @autoclosure () -> String, + file: StaticString, + line: UInt + ) { + Swift.precondition(condition(), message(), file: file, line: line) + } +} + +private struct TestAssertionEffect: AssertionEffect { + @_transparent + func callAsFunction( + _ condition: @autoclosure () -> Bool, + _ message: @autoclosure () -> String, + file: StaticString, + line: UInt + ) { + guard condition() else { return XCTFail(message(), file: file, line: line) } + } +} + +public protocol AssertionFailureEffect: Sendable { + func callAsFunction( + _ message: @autoclosure () -> String, + file: StaticString, + line: UInt + ) +} + +extension AssertionFailureEffect { + @_transparent + public func callAsFunction( + _ message: @autoclosure () -> String = "", + file: StaticString = #file, + line: UInt = #line + ) { + self.callAsFunction("", file: file, line: line) + } +} + +private struct AssertionFailure: AssertionFailureEffect { + let base: any AssertionEffect + + @_transparent + func callAsFunction( + _ message: @autoclosure () -> String, + file: StaticString, + line: UInt + ) { + self.base(false, message(), file: file, line: line) + } +} + +private enum AssertKey: DependencyKey { + public static let liveValue: any AssertionEffect = LiveAssertionEffect() + public static let testValue: any AssertionEffect = TestAssertionEffect() +} + +private enum PreconditionKey: DependencyKey { + public static let liveValue: any AssertionEffect = LivePreconditionEffect() + public static let testValue: any AssertionEffect = TestAssertionEffect() +} + +/// An ``AssertionEffect`` that invokes the given closure. +public struct AnyAssertionEffect: AssertionEffect { + private let assert: @Sendable ( _ condition: @autoclosure () -> Bool, _ message: @autoclosure () -> String, _ file: StaticString, @@ -77,28 +192,10 @@ public struct Assert: Sendable { public func callAsFunction( _ condition: @autoclosure () -> Bool, - _ message: @autoclosure () -> String = "", - file: StaticString = #file, - line: UInt = #line + _ message: @autoclosure () -> String, + file: StaticString, + line: UInt ) { self.assert(condition(), message(), file, line) } } - -private enum AssertKey: DependencyKey { - public static let liveValue = Assert { condition, message, file, line in - Swift.assert(condition(), message(), file: file, line: line) - } - public static let testValue = Assert { condition, message, file, line in - guard condition() else { return XCTFail(message(), file: file, line: line) } - } -} - -private enum PreconditionKey: DependencyKey { - public static let liveValue = Assert { condition, message, file, line in - Swift.precondition(condition(), message(), file: file, line: line) - } - public static let testValue = Assert { condition, message, file, line in - guard condition() else { return XCTFail(message(), file: file, line: line) } - } -} diff --git a/Sources/Dependencies/Documentation.docc/Extensions/DependencyValues.md b/Sources/Dependencies/Documentation.docc/Extensions/DependencyValues.md index e61c206a..4fbcadaf 100644 --- a/Sources/Dependencies/Documentation.docc/Extensions/DependencyValues.md +++ b/Sources/Dependencies/Documentation.docc/Extensions/DependencyValues.md @@ -5,7 +5,7 @@ ### Creating and accessing values - ``init()`` -- ``subscript(_:_:_:_:)`` +- ``subscript(key:file:function:line:) ### Overriding values @@ -18,6 +18,8 @@ ### Dependency values +- ``assert`` +- ``assertionFailure`` - ``calendar`` - ``context`` - ``continuousClock`` @@ -27,6 +29,8 @@ - ``mainQueue`` - ``mainRunLoop`` - ``openURL`` +- ``precondition`` +- ``preconditionFailure`` - ``suspendingClock`` - ``timeZone`` - ``urlSession`` diff --git a/Sources/Dependencies/Documentation.docc/Extensions/DependencyValuesAssert.md b/Sources/Dependencies/Documentation.docc/Extensions/DependencyValuesAssert.md new file mode 100644 index 00000000..a5b37d30 --- /dev/null +++ b/Sources/Dependencies/Documentation.docc/Extensions/DependencyValuesAssert.md @@ -0,0 +1,12 @@ +# ``Dependencies/DependencyValues/assert`` + +## Topics + +### Dependency values + +- ``AssertionEffect`` +- ``AssertionFailureEffect`` + +### Custom assertions + +- ``AnyAssertionEffect`` diff --git a/Tests/DependenciesTests/AssertTests.swift b/Tests/DependenciesTests/AssertTests.swift index 732acf0e..777afb62 100644 --- a/Tests/DependenciesTests/AssertTests.swift +++ b/Tests/DependenciesTests/AssertTests.swift @@ -36,7 +36,7 @@ final class AssertTests: XCTestCase { func testCustom() { let expectation = self.expectation(description: "assert") withDependencies { - $0.assert = Assert { condition, message, file, line in + $0.assert = AnyAssertionEffect { condition, message, file, line in expectation.fulfill() } } operation: { From f9462ca87c0e099d6fa2d842f83b6d162999d09f Mon Sep 17 00:00:00 2001 From: Stephen Celis Date: Tue, 7 May 2024 13:31:53 -0700 Subject: [PATCH 5/9] Update Sources/Dependencies/DependencyValues/Assert.swift --- Sources/Dependencies/DependencyValues/Assert.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Dependencies/DependencyValues/Assert.swift b/Sources/Dependencies/DependencyValues/Assert.swift index 38f2bfd2..67687b6e 100644 --- a/Sources/Dependencies/DependencyValues/Assert.swift +++ b/Sources/Dependencies/DependencyValues/Assert.swift @@ -64,7 +64,7 @@ extension DependencyValues { /// /// Equivalent to passing a `false` condition to ``DependencyValues/precondition``. public var preconditionFailure: any AssertionFailureEffect { - AssertionFailure(base: self.assert) + AssertionFailure(base: self.precondition) } } From 729a3317f958c0cd09e93ebb2c7b821364a3cbe8 Mon Sep 17 00:00:00 2001 From: Stephen Celis Date: Tue, 7 May 2024 14:05:38 -0700 Subject: [PATCH 6/9] wip --- Sources/Dependencies/DependencyValues/Assert.swift | 7 ------- .../Documentation.docc/Extensions/DependencyValues.md | 1 - 2 files changed, 8 deletions(-) diff --git a/Sources/Dependencies/DependencyValues/Assert.swift b/Sources/Dependencies/DependencyValues/Assert.swift index 67687b6e..108abb3c 100644 --- a/Sources/Dependencies/DependencyValues/Assert.swift +++ b/Sources/Dependencies/DependencyValues/Assert.swift @@ -59,13 +59,6 @@ extension DependencyValues { get { self[PreconditionKey.self] } set { self[PreconditionKey.self] = newValue } } - - /// A dependency for failing a precondition. - /// - /// Equivalent to passing a `false` condition to ``DependencyValues/precondition``. - public var preconditionFailure: any AssertionFailureEffect { - AssertionFailure(base: self.precondition) - } } /// A type for creating an assertion or precondition. diff --git a/Sources/Dependencies/Documentation.docc/Extensions/DependencyValues.md b/Sources/Dependencies/Documentation.docc/Extensions/DependencyValues.md index 4fbcadaf..8126b78e 100644 --- a/Sources/Dependencies/Documentation.docc/Extensions/DependencyValues.md +++ b/Sources/Dependencies/Documentation.docc/Extensions/DependencyValues.md @@ -30,7 +30,6 @@ - ``mainRunLoop`` - ``openURL`` - ``precondition`` -- ``preconditionFailure`` - ``suspendingClock`` - ``timeZone`` - ``urlSession`` From c1424f1ac5d294d42dcbebe005beb98fdeb6699a Mon Sep 17 00:00:00 2001 From: Stephen Celis Date: Tue, 7 May 2024 16:17:23 -0700 Subject: [PATCH 7/9] wip --- .../Dependencies/DependencyValues/Assert.swift | 6 ++++-- .../DependencyEndpointMacroTests.swift | 17 +++++++++++++++++ Tests/DependenciesTests/AssertTests.swift | 6 ++++++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/Sources/Dependencies/DependencyValues/Assert.swift b/Sources/Dependencies/DependencyValues/Assert.swift index 108abb3c..ae04c91d 100644 --- a/Sources/Dependencies/DependencyValues/Assert.swift +++ b/Sources/Dependencies/DependencyValues/Assert.swift @@ -74,6 +74,7 @@ public protocol AssertionEffect: Sendable { } extension AssertionEffect { + @_disfavoredOverload @_transparent public func callAsFunction( _ condition: @autoclosure () -> Bool, @@ -81,7 +82,7 @@ extension AssertionEffect { file: StaticString = #file, line: UInt = #line ) { - self.callAsFunction(condition(), "", file: file, line: line) + self.callAsFunction(condition(), message(), file: file, line: line) } } @@ -130,13 +131,14 @@ public protocol AssertionFailureEffect: Sendable { } extension AssertionFailureEffect { + @_disfavoredOverload @_transparent public func callAsFunction( _ message: @autoclosure () -> String = "", file: StaticString = #file, line: UInt = #line ) { - self.callAsFunction("", file: file, line: line) + self.callAsFunction(message(), file: file, line: line) } } diff --git a/Tests/DependenciesMacrosPluginTests/DependencyEndpointMacroTests.swift b/Tests/DependenciesMacrosPluginTests/DependencyEndpointMacroTests.swift index c5e6d98f..0239c6c9 100644 --- a/Tests/DependenciesMacrosPluginTests/DependencyEndpointMacroTests.swift +++ b/Tests/DependenciesMacrosPluginTests/DependencyEndpointMacroTests.swift @@ -874,6 +874,23 @@ final class DependencyEndpointMacroTests: BaseTestCase { public var bar: () -> String = { fatalError("Goodbye") } } """ + } expansion: { + #""" + struct Blah { + public var foo: () -> String = { fatalError() } + + private var _foo: () -> String = { + XCTestDynamicOverlay.XCTFail("Unimplemented: '\(Self.self).foo'") + fatalError() + } + public var bar: () -> String = { fatalError("Goodbye") } + + private var _bar: () -> String = { + XCTestDynamicOverlay.XCTFail("Unimplemented: '\(Self.self).bar'") + fatalError("Goodbye") + } + } + """# } } diff --git a/Tests/DependenciesTests/AssertTests.swift b/Tests/DependenciesTests/AssertTests.swift index 777afb62..9a4ca3cc 100644 --- a/Tests/DependenciesTests/AssertTests.swift +++ b/Tests/DependenciesTests/AssertTests.swift @@ -3,6 +3,7 @@ import XCTest final class AssertTests: XCTestCase { @Dependency(\.assert) var assert + @Dependency(\.assertionFailure) var assertionFailure @Dependency(\.precondition) var precondition func testPass() { @@ -22,6 +23,11 @@ final class AssertTests: XCTestCase { } issueMatcher: { $0.compactDescription == "Must be true" } + XCTExpectFailure { + assertionFailure("Failure") + } issueMatcher: { + $0.compactDescription == "Failure" + } XCTExpectFailure { precondition(false) } From 815215edcab98aad542dbf6f00fce2153a433ee2 Mon Sep 17 00:00:00 2001 From: Stephen Celis Date: Tue, 7 May 2024 16:24:04 -0700 Subject: [PATCH 8/9] wip --- .../xcshareddata/swiftpm/Package.resolved | 39 ++++++++++++------- Package.resolved | 20 +++++----- 2 files changed, 34 insertions(+), 25 deletions(-) diff --git a/Dependencies.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Dependencies.xcworkspace/xcshareddata/swiftpm/Package.resolved index 9fad66b3..356c6c59 100644 --- a/Dependencies.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Dependencies.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -14,8 +14,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-argument-parser", "state" : { - "revision" : "fddd1c00396eed152c45a46bea9f47b98e59301d", - "version" : "1.2.0" + "revision" : "46989693916f56d1186bd59ac15124caef896560", + "version" : "1.3.1" } }, { @@ -32,8 +32,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/pointfreeco/swift-clocks", "state" : { - "revision" : "d1fd837326aa719bee979bdde1f53cd5797443eb", - "version" : "1.0.0" + "revision" : "a8421d68068d8f45fbceb418fbf22c5dad4afd33", + "version" : "1.0.2" } }, { @@ -41,8 +41,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/pointfreeco/swift-concurrency-extras", "state" : { - "revision" : "ea631ce892687f5432a833312292b80db238186a", - "version" : "1.0.0" + "revision" : "bb5059bde9022d69ac516803f4f227d8ac967f71", + "version" : "1.1.0" } }, { @@ -50,7 +50,16 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-docc-plugin", "state" : { - "revision" : "3303b164430d9a7055ba484c8ead67a52f7b74f6", + "revision" : "26ac5758409154cc448d7ab82389c520fa8a8247", + "version" : "1.3.0" + } + }, + { + "identity" : "swift-docc-symbolkit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-docc-symbolkit", + "state" : { + "revision" : "b45d1f2ed151d057b54504d653e0da5552844e34", "version" : "1.0.0" } }, @@ -59,8 +68,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/pointfreeco/swift-macro-testing", "state" : { - "revision" : "35acd9468d40ae87e75991a18af6271e8124c261", - "version" : "0.2.1" + "revision" : "5c4a1b9d7c23cd5c08ea50677d8e89080365cb00", + "version" : "0.4.0" } }, { @@ -68,8 +77,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/pointfreeco/swift-snapshot-testing", "state" : { - "revision" : "bb0ea08db8e73324fe6c3727f755ca41a23ff2f4", - "version" : "1.14.2" + "revision" : "625ccca8570773dd84a34ee51a81aa2bc5a4f97a", + "version" : "1.16.0" } }, { @@ -77,8 +86,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-syntax", "state" : { - "revision" : "ffa3cd6fc2aa62adbedd31d3efaf7c0d86a9f029", - "version" : "509.0.1" + "revision" : "303e5c5c36d6a558407d364878df131c3546fad8", + "version" : "510.0.2" } }, { @@ -86,8 +95,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/pointfreeco/xctest-dynamic-overlay", "state" : { - "revision" : "b13b1d1a8e787a5ffc71ac19dcaf52183ab27ba2", - "version" : "1.1.1" + "revision" : "6f30bdba373bbd7fbfe241dddd732651f2fbd1e2", + "version" : "1.1.2" } } ], diff --git a/Package.resolved b/Package.resolved index 295b4a31..356c6c59 100644 --- a/Package.resolved +++ b/Package.resolved @@ -14,8 +14,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-argument-parser", "state" : { - "revision" : "c8ed701b513cf5177118a175d85fbbbcd707ab41", - "version" : "1.3.0" + "revision" : "46989693916f56d1186bd59ac15124caef896560", + "version" : "1.3.1" } }, { @@ -68,8 +68,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/pointfreeco/swift-macro-testing", "state" : { - "revision" : "90e38eec4bf661ec0da1bbfd3ec507d0f0c05310", - "version" : "0.3.0" + "revision" : "5c4a1b9d7c23cd5c08ea50677d8e89080365cb00", + "version" : "0.4.0" } }, { @@ -77,8 +77,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/pointfreeco/swift-snapshot-testing", "state" : { - "revision" : "5b0c434778f2c1a4c9b5ebdb8682b28e84dd69bd", - "version" : "1.15.4" + "revision" : "625ccca8570773dd84a34ee51a81aa2bc5a4f97a", + "version" : "1.16.0" } }, { @@ -86,8 +86,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-syntax", "state" : { - "revision" : "08a2f0a9a30e0f705f79c9cfaca1f68b71bdc775", - "version" : "510.0.0" + "revision" : "303e5c5c36d6a558407d364878df131c3546fad8", + "version" : "510.0.2" } }, { @@ -95,8 +95,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/pointfreeco/xctest-dynamic-overlay", "state" : { - "revision" : "b13b1d1a8e787a5ffc71ac19dcaf52183ab27ba2", - "version" : "1.1.1" + "revision" : "6f30bdba373bbd7fbfe241dddd732651f2fbd1e2", + "version" : "1.1.2" } } ], From 56963f701db2cb03fdab5be6a2f1119185fb940e Mon Sep 17 00:00:00 2001 From: Stephen Celis Date: Tue, 7 May 2024 16:28:24 -0700 Subject: [PATCH 9/9] wip --- .../DependencyEndpointMacroTests.swift | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/Tests/DependenciesMacrosPluginTests/DependencyEndpointMacroTests.swift b/Tests/DependenciesMacrosPluginTests/DependencyEndpointMacroTests.swift index 0239c6c9..c5e6d98f 100644 --- a/Tests/DependenciesMacrosPluginTests/DependencyEndpointMacroTests.swift +++ b/Tests/DependenciesMacrosPluginTests/DependencyEndpointMacroTests.swift @@ -874,23 +874,6 @@ final class DependencyEndpointMacroTests: BaseTestCase { public var bar: () -> String = { fatalError("Goodbye") } } """ - } expansion: { - #""" - struct Blah { - public var foo: () -> String = { fatalError() } - - private var _foo: () -> String = { - XCTestDynamicOverlay.XCTFail("Unimplemented: '\(Self.self).foo'") - fatalError() - } - public var bar: () -> String = { fatalError("Goodbye") } - - private var _bar: () -> String = { - XCTestDynamicOverlay.XCTFail("Unimplemented: '\(Self.self).bar'") - fatalError("Goodbye") - } - } - """# } }