我正在关注此blog中的示例来测试我的JSON编码/解码,并遇到了深层嵌套JSON的问题。 JSON结构具有太多排列,无法通过quickcheck成功进行测试。我的客户端Elm编码/解码模糊测试遇到了类似的问题。我能够通过单独测试根节点下的两个分支,然后使用分支的常量值测试根节点(因为它们已经过测试)来克服这个问题。 Elm和haskell代码是here。
是否有类似的解决方案可以应用于haskell?
我的榆树代码注释:
-- Initially `round trip table` attempted to fuzz test the entire table structure.
-- This was conuming massive amounts of memory (>1.5G) until the node process ran
-- out of memory. To overcome this I fuzz test the board and sprite structures
-- individually and then fuzz test the table structure using Fuzz.constant on the
-- board and sprite lists so that it does not consume too much memory on the
-- already fuzz tested structures.