Guest User

Untitled

a guest
Mar 24th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. let list = SwiftListWrapper(dataSize: 1)
  2. list.push_back(value: "1".data(using: .utf8)!)
  3. list.push_back(value: "2".data(using: .utf8)!)
  4. list.push_back(value: "3".data(using: .utf8)!)
  5. list.push_front(value: "0".data(using: .utf8)!)
  6.  
  7. XCTAssertEqual(list.size(), 4)
  8.  
  9. XCTAssertEqual(String.init(data: list.front()!, encoding: .utf8), "0")
  10.  
  11. let it = list.begin()
  12.  
  13. let _ = it.increment()
  14. let _ = it.increment()
  15.  
  16. XCTAssertEqual(String.init(data: it.value()!, encoding: .utf8), "2")
Add Comment
Please, Sign In to add comment