Skip to content

Commit

Permalink
add delteMin property check
Browse files Browse the repository at this point in the history
  • Loading branch information
xianlinbox committed Jun 9, 2016
1 parent 3faa2e6 commit 6736b8c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/main/scala/quickcheck/QuickCheck.scala
Expand Up @@ -9,18 +9,26 @@ import Prop._

abstract class QuickCheckHeap extends Properties("Heap") with IntHeap {

property("min1") = forAll { a: Int =>
property("findMin1") = forAll { a: Int =>
val h = insert(a, empty)
findMin(h) == a
}

property("min2") = forAll { a: Int =>
property("findMin2") = forAll { a: Int =>
val h1 = insert(a, empty)
val h2 = insert(a + 1, h1)
findMin(h2) == a
}


property("deleteMin1") = forAll { a: Int =>
val h1 = insert(a, empty)
val h2 = insert(a + 1, h1)
val h3 = deleteMin(h2)
findMin(h3) == a + 1
}


property("meld") = forAll { a: Int =>
val h1 = insert(a, empty)
val h2 = insert(a + 1, empty)
Expand Down

0 comments on commit 6736b8c

Please sign in to comment.