Exception upon using FsCheck

孤街醉人 提交于 2019-12-08 07:40:53

问题


Upon running with xUnit the simplest test from FsCheck

open FsCheck

[<Property>]
let revRevIsOrig (xs:list<int>) = 
        List.rev(List.rev xs) = xs

I receive the exception

---- System.InvalidCastException : Unable to cast object of type 'FsList@303[System.Int32]' 
to type 'FsCheck.Arbitrary`1[Microsoft.FSharp.Collections.FSharpList`1[System.Int32]]'.

I tried to catch the exception and debug, but occurs before Would anyone have any clue on how to solve this ?

Way to reproduce:

  • make a new project
  • install FsCheck.xUnit NUget
  • put that code into the fs file
  • run the tests

来源:https://stackoverflow.com/questions/14530385/exception-upon-using-fscheck

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!