Monoid.hs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. {-# LANGUAGE TemplateHaskell #-}
  2. module Internal.Utils.Monoid ( tests ) where
  3. import Agda.Utils.Monoid
  4. import Internal.Helpers
  5. ------------------------------------------------------------------------
  6. -- Instances
  7. instance Arbitrary MaxNat where
  8. arbitrary = do
  9. NonNegative x <- arbitrary :: Gen (NonNegative Int)
  10. return (MaxNat x)
  11. ------------------------------------------------------------------------------
  12. -- Properties
  13. -- | 'MaxNat' is a monoid.
  14. prop_monoid_MaxNat :: Property3 MaxNat
  15. prop_monoid_MaxNat = isMonoid
  16. ------------------------------------------------------------------------
  17. -- * All tests
  18. ------------------------------------------------------------------------
  19. -- Template Haskell hack to make the following $allProperties work
  20. -- under ghc-7.8.
  21. return [] -- KEEP!
  22. -- | All tests as collected by 'allProperties'.
  23. --
  24. -- Using 'allProperties' is convenient and superior to the manual
  25. -- enumeration of tests, since the name of the property is added
  26. -- automatically.
  27. tests :: TestTree
  28. tests = testProperties "Internal.Utils.Monoid" $allProperties