1
1
mirror of https://github.com/github/semantic.git synced 2024-11-29 11:02:26 +03:00

Add a little API for diffs.

This commit is contained in:
Rob Rix 2015-10-06 13:22:37 -04:00
parent 5a86df7a8d
commit 0d8c080f35

View File

@ -33,6 +33,18 @@ final class DiffTests: XCTestCase {
}
}
private func insert(term: Term) -> Diff {
return Diff.Pure(.Insert(term))
}
private func delete(term: Term) -> Diff {
return Diff.Pure(.Delete(term))
}
private func copy(term: Term) -> Diff {
return Diff.Roll(term.out.map(copy))
}
private typealias Term = Fix<Info>
private typealias Diff = Free<Info, Patch<Info>>