mirror of
https://github.com/github/semantic.git
synced 2024-11-28 01:47:01 +03:00
Test simple updates to subtrees.
This commit is contained in:
parent
336c2b87b2
commit
b948f10dc1
@ -47,6 +47,10 @@ final class LocationTests: XCTestCase {
|
||||
func testSequenceIsPreOrderDepthFirstTraversal() {
|
||||
assert(term.explore().map { $0.it.extract }, ==, [ 0, 1, 2, 3, 5, 4 ])
|
||||
}
|
||||
|
||||
func testModifyReplacesSubtrees() {
|
||||
assert(term.explore().down?.modify(const(leafB)).right?.up?.it, ==, Cofree(0, .Indexed([ leafB, leafB, keyed ])))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -67,4 +71,5 @@ private let term: Cofree<String, Int> = Cofree(0, .Indexed([
|
||||
|
||||
import Assertions
|
||||
@testable import Doubt
|
||||
import Prelude
|
||||
import XCTest
|
||||
|
Loading…
Reference in New Issue
Block a user