Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reference IssueReporting symbols instead of XCTestDynamicOverlay #3256

Merged
merged 1 commit into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-issue-reporting",
"state" : {
"revision" : "926f43898706eaa127db79ac42138e1ad7e85a3f",
"version" : "1.2.0"
"revision" : "357ca1e5dd31f613a1d43320870ebc219386a495",
"version" : "1.2.2"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-issue-reporting",
"state" : {
"revision" : "926f43898706eaa127db79ac42138e1ad7e85a3f",
"version" : "1.2.0"
"revision" : "357ca1e5dd31f613a1d43320870ebc219386a495",
"version" : "1.2.2"
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-issue-reporting",
"state" : {
"revision" : "926f43898706eaa127db79ac42138e1ad7e85a3f",
"version" : "1.2.0"
"revision" : "357ca1e5dd31f613a1d43320870ebc219386a495",
"version" : "1.2.2"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ let package = Package(
.package(url: "https://github.com/pointfreeco/swift-macro-testing", from: "0.2.0"),
.package(url: "https://github.com/pointfreeco/swift-perception", from: "1.3.3"),
.package(url: "https://github.com/pointfreeco/swiftui-navigation", from: "1.5.2"),
.package(url: "https://github.com/pointfreeco/swift-issue-reporting", from: "1.2.0"),
.package(url: "https://github.com/pointfreeco/swift-issue-reporting", from: "1.2.2"),
.package(url: "https://github.com/swiftlang/swift-syntax", "509.0.0"..<"601.0.0-prerelease"),
],
targets: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1133,7 +1133,7 @@ struct MainApp: App {

var body: some Scene {
WindowGroup {
if _XCTIsTesting {
if isTesting {
// NB: Don't run application in tests to avoid interference
// between the app and the test.
EmptyView()
Expand Down
35 changes: 3 additions & 32 deletions Sources/ComposableArchitecture/Reducer/Reducers/StackReducer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ public struct StackState<Element> {
_read { yield self._dictionary[id] }
_modify { yield &self._dictionary[id] }
set {
switch (self.ids.contains(id), newValue, _XCTIsTesting) {
switch (self.ids.contains(id), newValue, isTesting) {
case (true, _, _), (false, .some, true):
self._dictionary[id] = newValue
case (false, .some, false):
if !_XCTIsTesting {
if !isTesting {
reportIssue(
"Can't assign element at missing ID.",
fileID: fileID.rawValue,
Expand All @@ -65,35 +65,6 @@ public struct StackState<Element> {
}
}

// subscript(
// id id: StackElementID,
// fileID fileID: HashableStaticString,
// filePath filePath: HashableStaticString,
// line line: UInt = #line,
// column column: UInt = #column
// ) -> Element? {
// _read { yield self._dictionary[id] }
// _modify { yield &self._dictionary[id] }
// set {
// switch (self.ids.contains(id), newValue, _XCTIsTesting) {
// case (true, _, _), (false, .some, true):
// self._dictionary[id] = newValue
// case (false, .some, false):
// if !_XCTIsTesting {
// reportIssue(
// "Can't assign element at missing ID.",
// fileID: fileID.rawValue,
// filePath: filePath.rawValue,
// line: line,
// column: column
// )
// }
// case (false, .none, _):
// break
// }
// }
// }

/// Accesses the value associated with the given id and case for reading and writing.
///
/// When using stack-based navigation (see <doc:StackBasedNavigation>) you will typically have a
Expand Down Expand Up @@ -755,7 +726,7 @@ extension StackElementID: CustomDumpStringConvertible {

extension StackElementID: ExpressibleByIntegerLiteral {
public init(integerLiteral value: Int) {
if !_XCTIsTesting {
if !isTesting {
fatalError(
"""
Specifying stack element IDs by integer literal is not allowed outside of tests.
Expand Down