mirror of
https://github.com/github/semantic.git
synced 2024-12-01 09:15:01 +03:00
Test that the before state is recoverable.
Apparently it is sometimes not!
This commit is contained in:
parent
22fe4c4ebb
commit
20fa9ba32a
@ -19,6 +19,15 @@ final class DiffTests: XCTestCase {
|
||||
Free.equals(ifPure: Patch.equals(Cofree.equals(annotation: ==, leaf: ==)), ifRoll: ==)(diff.diff, diff.diff)
|
||||
}
|
||||
}
|
||||
|
||||
func testOriginalTermsAreRecoverable() {
|
||||
let equal = Cofree<String, ()>.equals(annotation: const(true), leaf: ==)
|
||||
property("before state is recoverable") <- forAll { (diff: RangedDiff) in
|
||||
return diff.diff.map { $0.map { $0.map(const(())) } }.before.map {
|
||||
equal($0, diff.a.map(const(())))
|
||||
} ?? false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user