1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 23:42:31 +03:00

Test SES inserting at head.

This commit is contained in:
Rob Rix 2015-09-17 15:55:30 -04:00
parent 1fd445c1ef
commit 8c642c6f94

View File

@ -10,10 +10,16 @@ final class DiffTests: XCTestCase {
func testSESOverNonEmptyAndEmptyCollectionsIsDeletions() {
XCTAssertEqual(Diff.diff([ a, b ], []), [ Diff.Patch(a, .Empty), Diff.Patch(b, .Empty) ])
}
func testSESCanInsertAtHead() {
XCTAssertEqual(Diff.diff([ a, b, c ], [ d, a, b, c ]), [ Diff.Insert(d), Diff(a), Diff(b), Diff(c) ])
}
}
private let a = Fix(.Literal("a"))
private let b = Fix(.Literal("b"))
private let c = Fix(.Literal("c"))
private let d = Fix(.Literal("d"))
import Doubt
import XCTest