1
1
mirror of https://github.com/github/semantic.git synced 2024-12-20 13:21:59 +03:00
semantic/prototype/DoubtTests/DiffTests.swift

23 lines
544 B
Swift
Raw Normal View History

2015-10-17 00:07:37 +03:00
final class DiffTests: XCTestCase {
override static func setUp() {
sranddev()
}
2015-10-17 00:13:51 +03:00
typealias Term = RangedTerm.Term
typealias Diff = Free<String, Patch<Term>>
2015-10-17 00:13:59 +03:00
let interpreter = Interpreter<Term>(equal: ==, comparable: const(true), cost: Diff.sum(const(1)))
func testEqualTermsProduceIdentityDiffs() {
property("equal terms produce identity diffs") <- forAll { (term: RangedTerm) in
Diff.sum(const(1))(self.interpreter.run(term.term, term.term)) == 0
}
}
2015-10-17 00:07:37 +03:00
}
@testable import Doubt
2015-10-17 00:13:59 +03:00
import Prelude
2015-10-17 00:07:37 +03:00
import SwiftCheck
import XCTest