Skip to content

Commit

Permalink
Swift 5.8 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-fowler committed Apr 10, 2024
1 parent 89b7d8c commit 93c2d71
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Tests/SotoCoreTests/Concurrency/ExpiringValueTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ final class ExpiringValueTests: XCTestCase {

/// Test when a value is just about to expire it returns current value and kicks off
/// new task to get new value
#if swift(>=5.9) // makeStream doesn't exist in earlier versions of swift
func testJustAboutToExpireValue() async throws {
let expiringValue = ExpiringValue<Int>(0, expires: Date() + 1, threshold: 3)
let (stream, source) = AsyncStream.makeStream(of: Void.self)
let (stream, source) = AsyncStream<Void>.makeStream()
let value = try await expiringValue.getValue {
source.finish()
try await Task.sleep(nanoseconds: 1000)
Expand All @@ -51,6 +52,7 @@ final class ExpiringValueTests: XCTestCase {
// test it return current value
XCTAssertEqual(value, 0)
}
#endif

/// Test closure is not called if value has not expired
func testClosureNotCalled() async throws {
Expand Down

0 comments on commit 93c2d71

Please sign in to comment.