From 8c642c6f949aad404f3fea777ce097f5e9ffbb6f Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Thu, 17 Sep 2015 15:55:30 -0400 Subject: [PATCH] Test SES inserting at head. --- prototype/DoubtTests/DiffTests.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/prototype/DoubtTests/DiffTests.swift b/prototype/DoubtTests/DiffTests.swift index c60a27b84..d83f05cbc 100644 --- a/prototype/DoubtTests/DiffTests.swift +++ b/prototype/DoubtTests/DiffTests.swift @@ -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