Skip to content

Commit

Permalink
Add tests for empty arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
soffes committed Apr 13, 2016
1 parent e796045 commit a1d03eb
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Tests/Diff/DiffTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@ class DiffTests: XCTestCase {
XCTAssertNil(diff("Hello", "Hello"))
}

func testEmptyLHS() {
let (range, string) = diff("", "Hello world")!
XCTAssertEqual(0...0, range)
XCTAssertEqual("Hello world", string)
}

func testEmptyRHS() {
let (range, string) = diff("Hello world", "")!
XCTAssertEqual(0..<11, range)
XCTAssertEqual("", string)
}

func testIntArray() {
let (range, replacement) = diff([1, 2, 3], [1, 2, 3, 4])!
XCTAssertEqual(3...3, range)
Expand Down

0 comments on commit a1d03eb

Please sign in to comment.