mirror of
https://github.com/github/semantic.git
synced 2024-12-25 07:55:12 +03:00
Test SES inserting at head.
This commit is contained in:
parent
1fd445c1ef
commit
8c642c6f94
@ -10,10 +10,16 @@ final class DiffTests: XCTestCase {
|
|||||||
func testSESOverNonEmptyAndEmptyCollectionsIsDeletions() {
|
func testSESOverNonEmptyAndEmptyCollectionsIsDeletions() {
|
||||||
XCTAssertEqual(Diff.diff([ a, b ], []), [ Diff.Patch(a, .Empty), Diff.Patch(b, .Empty) ])
|
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 a = Fix(.Literal("a"))
|
||||||
private let b = Fix(.Literal("b"))
|
private let b = Fix(.Literal("b"))
|
||||||
|
private let c = Fix(.Literal("c"))
|
||||||
|
private let d = Fix(.Literal("d"))
|
||||||
|
|
||||||
import Doubt
|
import Doubt
|
||||||
import XCTest
|
import XCTest
|
||||||
|
Loading…
Reference in New Issue
Block a user