项目作者: dfordivam

项目描述 :
Use Hedgehog (like QuickCheck) to simplify types (and life) when using reflex-frp
高级语言: Haskell
项目地址: git://github.com/dfordivam/reflex-type-simplify.git
创建时间: 2017-05-18T07:35:24Z
项目社区:https://github.com/dfordivam/reflex-type-simplify

开源协议:

下载


reflex-type-simplify

Use Hedgehog (like QuickCheck) to simplify types (and life) when using reflex-frp

Work in progess.. This is just a preview…

Also See https://github.com/hedgehogqa/haskell-hedgehog

  1. Enter the starting type
  2. Dynamic t (m (Event t Int))
  3. Enter the target type
  4. m (Event t Int)
  5. <interactive> failed after 117 tests and 86 shrinks.
  6. ┏━━ Main.hs ━━━
  7. 108 testStr :: String -> String -> Property
  8. 109 testStr str1 str2 = withTests (TestLimit 1000000) . property $ do
  9. 110 let
  10. 111 (Right init) = parseSourceType str1
  11. 112 (Right res) = parseSourceType str2
  12. 113
  13. 114
  14. 115 -- Result --------------------------
  15. 116 s <- forAll $ (opsManualRecurse init)
  16. ((join) . (fmap (fmap (switchPromptlyDyn))) . (fmap (holdDyn)) . (dyn))
  17. 117 assert $ (applyOpTree init s) /= (Just res)
  18. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  19. This failure can be reproduced by running:
  20. > recheck (Size 16) (Seed 3033341105344009770 5793933252947687363) <property>

This work is inspired by
http://clrnd.com.ar/posts/2017-04-21-the-water-jug-problem-in-hedgehog.html