使用FsCheck时出现异常

时间:2013-01-25 21:05:04

标签: testing f# xunit fscheck

使用xUnit运行FsCheck中最简单的测试

open FsCheck

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

我收到了例外

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

我试图捕获异常和调试,但之前发生过 有人会对如何解决这个问题有任何线索吗?

重现方式:

  • 制作新项目
  • 安装FsCheck.xUnit NUget
  • 将该代码放入fs文件
  • 运行测试

0 个答案:

没有答案