1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 08:54:07 +03:00

Test that locations are sequenced in depth-first pre-order.

This commit is contained in:
Rob Rix 2015-11-05 11:38:15 -05:00
parent 59ef9b1eb4
commit 839a62ff0c

View File

@ -43,6 +43,10 @@ final class LocationTests: XCTestCase {
func testCanReturnToStartOfExplorationFromArbitrarilyDeepNodes() {
assert(term.explore().down?.right?.right?.down?.right?.root.it, ==, term)
}
func testSequenceIsPreOrderDepthFirstTraversal() {
assert(term.explore().map { $0.it.extract }, ==, [ 0, 1, 2, 3, 5, 4 ])
}
}