Skip to content

Commit

Permalink
Add a test of infinite stream concatenation.
Browse files Browse the repository at this point in the history
  • Loading branch information
robrix committed May 8, 2015
1 parent 57d3979 commit 6123b5f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions StreamTests/StreamTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@ class StreamTests: XCTestCase {
XCTAssertEqual(reduce(concatenated, "0", { $0 + toString($1) }), "0123456")
}

func testConcatenationOfInfiniteStreams() {
let concatenated = fibonacci ++ fibonacci
XCTAssertEqual(concatenated.first ?? -1, 1)
}

func testFoldLeft() {
XCTAssertEqual(Stream([1, 2, 3]).foldLeft("0", { $0 + toString($1) }), "0123")
}
Expand Down

0 comments on commit 6123b5f

Please sign in to comment.