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

Mark AsyncDefaults as unavailable #1069

Merged
merged 1 commit into from
Jul 29, 2023
Merged
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
6 changes: 3 additions & 3 deletions Sources/Nimble/Polling.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
/// If you are running on a slower machine, it could be useful to increase the default timeout value
/// or slow down poll interval. Default timeout interval is 1, and poll interval is 0.01.
///
/// - Warning: This has been renamed to ``PollingDefaults``. Starting in Nimble 13, the deprecation warning will change to a compiler error (removed). In Nimble 14, `AsyncDefaults` will be removed entirely.
/// - Warning: This has been renamed to ``PollingDefaults``. Starting in Nimble 14, `AsyncDefaults` will be removed entirely.
///
/// For the time being, `AsyncDefaults` will function the same.
/// However, `AsyncDefaults` will be removed in a future release.
@available(*, deprecated, renamed: "PollingDefaults")
@available(*, unavailable, renamed: "PollingDefaults")
public struct AsyncDefaults {
public static var timeout: NimbleTimeInterval {
get {
Expand All @@ -33,7 +33,7 @@
/// If you are running on a slower machine, it could be useful to increase the default timeout value
/// or slow down poll interval. Default timeout interval is 1, and poll interval is 0.01.
///
/// Note: This used to be known as ``AsyncDefaults``.
/// - Note: This used to be known as ``AsyncDefaults``.
public struct PollingDefaults {
public static var timeout: NimbleTimeInterval = .seconds(1)
public static var pollInterval: NimbleTimeInterval = .milliseconds(10)
Expand Down Expand Up @@ -128,7 +128,7 @@
/// @warning
/// This form of `toEventually` does not work in any kind of async context. Use the async form of `toEventually` if you are running tests in an async context.
@discardableResult
@available(*, noasync, message: "the sync version of `toEventually` does not work in async contexts. Use the async version with the same name as a drop-in replacement")

Check warning on line 131 in Sources/Nimble/Polling.swift

View workflow job for this annotation

GitHub Actions / lint

Line Length Violation: Line should be 160 characters or less; currently it has 172 characters (line_length)
public func toEventually(_ predicate: Predicate<Value>, timeout: NimbleTimeInterval = PollingDefaults.timeout, pollInterval: NimbleTimeInterval = PollingDefaults.pollInterval, description: String? = nil) -> Self {
nimblePrecondition(expression.isClosure, "NimbleInternalError", toEventuallyRequiresClosureError.stringValue)

Expand Down Expand Up @@ -161,7 +161,7 @@
/// This form of `toEventuallyNot` does not work in any kind of async context.
/// Use the async form of `toEventuallyNot` if you are running tests in an async context.
@discardableResult
@available(*, noasync, message: "the sync version of `toEventuallyNot` does not work in async contexts. Use the async version with the same name as a drop-in replacement")

Check warning on line 164 in Sources/Nimble/Polling.swift

View workflow job for this annotation

GitHub Actions / lint

Line Length Violation: Line should be 160 characters or less; currently it has 175 characters (line_length)
public func toEventuallyNot(_ predicate: Predicate<Value>, timeout: NimbleTimeInterval = PollingDefaults.timeout, pollInterval: NimbleTimeInterval = PollingDefaults.pollInterval, description: String? = nil) -> Self {
nimblePrecondition(expression.isClosure, "NimbleInternalError", toEventuallyRequiresClosureError.stringValue)

Expand Down Expand Up @@ -196,7 +196,7 @@
/// This form of `toNotEventually` does not work in any kind of async context.
/// Use the async form of `toNotEventually` if you are running tests in an async context.
@discardableResult
@available(*, noasync, message: "the sync version of `toNotEventually` does not work in async contexts. Use the async version with the same name as a drop-in replacement")

Check warning on line 199 in Sources/Nimble/Polling.swift

View workflow job for this annotation

GitHub Actions / lint

Line Length Violation: Line should be 160 characters or less; currently it has 175 characters (line_length)
public func toNotEventually(_ predicate: Predicate<Value>, timeout: NimbleTimeInterval = PollingDefaults.timeout, pollInterval: NimbleTimeInterval = PollingDefaults.pollInterval, description: String? = nil) -> Self {
return toEventuallyNot(predicate, timeout: timeout, pollInterval: pollInterval, description: description)
}
Expand All @@ -212,7 +212,7 @@
/// This form of `toNever` does not work in any kind of async context.
/// Use the async form of `toNever` if you are running tests in an async context.
@discardableResult
@available(*, noasync, message: "the sync version of `toNever` does not work in async contexts. Use the async version with the same name as a drop-in replacement")

Check warning on line 215 in Sources/Nimble/Polling.swift

View workflow job for this annotation

GitHub Actions / lint

Line Length Violation: Line should be 160 characters or less; currently it has 167 characters (line_length)
public func toNever(_ predicate: Predicate<Value>, until: NimbleTimeInterval = PollingDefaults.timeout, pollInterval: NimbleTimeInterval = PollingDefaults.pollInterval, description: String? = nil) -> Self {
nimblePrecondition(expression.isClosure, "NimbleInternalError", toEventuallyRequiresClosureError.stringValue)

Expand Down Expand Up @@ -247,7 +247,7 @@
/// This form of `neverTo` does not work in any kind of async context.
/// Use the async form of `neverTo` if you are running tests in an async context.
@discardableResult
@available(*, noasync, message: "the sync version of `neverTo` does not work in async contexts. Use the async version with the same name as a drop-in replacement")

Check warning on line 250 in Sources/Nimble/Polling.swift

View workflow job for this annotation

GitHub Actions / lint

Line Length Violation: Line should be 160 characters or less; currently it has 167 characters (line_length)
public func neverTo(_ predicate: Predicate<Value>, until: NimbleTimeInterval = PollingDefaults.timeout, pollInterval: NimbleTimeInterval = PollingDefaults.pollInterval, description: String? = nil) -> Self {
return toNever(predicate, until: until, pollInterval: pollInterval, description: description)
}
Expand Down
Loading