Skip to content

Instantly share code, notes, and snippets.

@truizlop
Created July 24, 2018 12:21
Show Gist options
  • Save truizlop/c19d25edb8f01fbfac1064dadb9f1f63 to your computer and use it in GitHub Desktop.
Save truizlop/c19d25edb8f01fbfac1064dadb9f1f63 to your computer and use it in GitHub Desktop.
func testConcatIsAssociative() {
for _ in 0 ..< 100 {
let a = randomString()
let b = randomString()
let c = randomString()
let result1 = concat(first: concat(first: a, second: b), second: c)
let result2 = concat(first: a, second: concat(first: b, second: c))
XCTAssertEqual(result1, result2)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment