Checking Properties
HEAT provides a very flexible mechanism for checking all properties of the program in the editor. You just have to select Check Properties in the menu or toolbar.

Properties are functions or constants with the prefix prop_ whose definitions start in column 1.

For checking a property HEAT applies a checking function to the property and evaluates the expression. If the evaluation result contains a certain string, then checking was successful, otherwise not.
  • Boolean unit tests:
    Properties are constants of type Bool, e.g.
      prop_sort = sort [3,2,1,2] == [1,2,2,3]

    Here the test function is empty and the desired positive result is True.
  • QuickCheck test properties:
    Properties are of type Testable prop => prop, e.g
      prop_sort :: [Int] -> Bool
      prop_sort xs = sort (sort xs) == sort xs

    Here the test function is quickCheck and the desired positive result is OK.
Under the menu item Options you can set both test function and desired positive result for property checking.