Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Commit

Permalink
Update DispatchQueue scheduler to match iOS 14.2 behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
broadwaylamb committed Nov 7, 2020
1 parent 96214ac commit 4977ca1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Sources/OpenCombineDispatch/DispatchQueue+Scheduler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ extension DispatchQueue {
/// - Parameter exactly: A binary integer representing a time interval.
public init?<Source: BinaryInteger>(exactly source: Source) {
guard let value = Int(exactly: source) else { return nil }
self = .nanoseconds(value)
self = .seconds(value)
}

public static func < (lhs: Stride, rhs: Stride) -> Bool {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ final class DispatchQueueSchedulerTests: XCTestCase {
XCTAssertEqual((2 as Stride).magnitude, 2_000_000_000)

XCTAssertNil(Stride(exactly: UInt64.max))
XCTAssertEqual(Stride(exactly: 871 as UInt64)?.magnitude, 871)
XCTAssertEqual(Stride(exactly: 2 as UInt64)?.magnitude, 2_000_000_000)
}

func testStrideFromTooMuchSecondsCrashes() {
Expand Down

0 comments on commit 4977ca1

Please sign in to comment.