Skip to content

Commit a883ec4

Browse files
committed
restore test
1 parent c7483bd commit a883ec4

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

Tests/MutexTests.swift

+12-12
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,18 @@ final class MutexTests: XCTestCase {
4949
}
5050
}
5151

52-
// func testLockIfAvailable_ReturnsValue() {
53-
// let mutex = Mutex("fish")
54-
// mutex.lock.unsafeLock()
55-
// XCTAssertNil(
56-
// mutex.withLockIfAvailable { _ in "chips" }
57-
// )
58-
// mutex.lock.unsafeUnlock()
59-
// XCTAssertEqual(
60-
// mutex.withLockIfAvailable { _ in "chips" },
61-
// "chips"
62-
// )
63-
// }
52+
func testLockIfAvailable_ReturnsValue() {
53+
let mutex = Mutex("fish")
54+
mutex.lock.unsafeLock()
55+
XCTAssertNil(
56+
mutex.withLockIfAvailable { _ in "chips" }
57+
)
58+
mutex.lock.unsafeUnlock()
59+
XCTAssertEqual(
60+
mutex.withLockIfAvailable { _ in "chips" },
61+
"chips"
62+
)
63+
}
6464

6565
func testWithLockIfAvailable_ThrowsError() {
6666
let mutex = Mutex("fish")

0 commit comments

Comments
 (0)