Skip to content

Commit

Permalink
Updated tests and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Zach Eriksen committed Jan 11, 2021
1 parent 463040e commit f094947
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 30 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Chain

A description of this package.
> Chain.link.complete
```swift
Chain.link(
{ print("Chain.link") },
.complete { print("Chain.complete") }
)
.run()
```
35 changes: 6 additions & 29 deletions Tests/ChainTests/ChainTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,23 @@ import XCTest

final class ChainTests: XCTestCase {
func testExample() {
var isLooping = true

var text = ""


Chain.link(
{ print(0) },
.link(
{ print(1) },
.background(
{ print(2)
sleep(3)
},
.link(
{ print(3) },
.complete {
text = "Hello, World?"
}
)
.link(
{ print(3) },
.complete {
text = "Hello, World!"
}
)
)
)
.run()

Chain.background(
{
sleep(5)
},
.link(
{
XCTAssertEqual(text, "Hello, World!")
},
.complete {
isLooping = false
}
)
)
.run()

while isLooping { }
XCTAssertEqual(text, "Hello, World!")
}

static var allTests = [
Expand Down

0 comments on commit f094947

Please sign in to comment.