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

Test deep modifications replacing subtrees.

This commit is contained in:
Rob Rix 2015-11-05 11:49:07 -05:00
parent d52c5ddedd
commit 7276b42d6f

View File

@ -55,6 +55,10 @@ final class LocationTests: XCTestCase {
func testMultipleModificationsReplaceMultipleSubtrees() {
assert(term.explore().down?.modify(const(leafB)).right?.modify(const(leafA)).up?.it, ==, Cofree(0, .Indexed([ leafB, leafA, keyed ])))
}
func testDeepModificationsReplaceDeepSubtrees() {
assert(term.explore().down?.modify(const(leafB)).right?.modify(const(leafA)).right?.down?.modify(const(innerLeafA)).right?.modify(const(innerLeafB)).root.it, ==, Cofree(0, .Indexed([ leafB, leafA, Cofree(3, .Keyed([ "a": innerLeafB, "b": innerLeafA ])) ])))
}
}