mausch / Fuchu

Functional test library for F# / C# / VB.NET
Apache License 2.0
120 stars 22 forks source link

FsCheck integration #43

Closed christolo closed 9 years ago

christolo commented 9 years ago

I'm using the sample from the docs. My whole console app is this:

open Fuchu open Fuchu.FuchuFsCheck open FsCheck

module PropertyTests =

let config = { FsCheck.Config.Default with MaxTest = 10000 }

let properties = 
    testList "FsCheck" [
        testProperty "Addition is commutative" <|
            fun a b -> 
                a + b = b + a

        // you can also override the FsCheck config
        testPropertyWithConfig config "Product is distributive over addition" <|
            fun a b c -> 
                a * (b + c) = a * b + a * c
    ]

run properties

[] let main args = defaultMainThisAssembly args

And I get this error: The module/namespace 'FsCheck.Fluent' from compilation unit 'FsCheck' did not contain the namespace, module or type 'SpecBuilder`1'

.NET 4.6 FSharp 4.3.1.0 FsCheck 2.1.0 FSharp.Core 3.1.2.5 Fuchu 0.6.0.0 Fuchu.FsCheck 0.6.0.0

Any thoughts? Thanks.

mausch commented 9 years ago

Fuchu.FsCheck 0.6.0.0 only works with FsCheck 1.x...

FsCheck 2.x introduced quite a few breaking changes, we have to update it in the Fuchu codebase and make a new release.

christolo commented 9 years ago

Ah, ok. Thanks for the update!

lapponiandevil commented 9 years ago

Hi guys, I'm running into the same error. When running with my own settings instead of FsCheck.Config.Default, my error message changes to this:

basic/Addition is commutative: Exception: System.MissingMethodException: Method 'Runner.get_init' not found.
  at Fuchu.Impl+evalTestList@260-1.Invoke (System.Tuple`2 tupledArg) [0x00000] in <filename unknown>:0  (00:00:00.0003217)
1 tests run: 0 passed, 0 ignored, 0 failed, 1 errored (00:00:00.1234726)
christolo commented 9 years ago

I changed to FsCheck 1.* and my issue was resolved.

Date: Thu, 22 Oct 2015 07:20:00 -0700 From: notifications@github.com To: Fuchu@noreply.github.com CC: chris.keenan@outlook.com Subject: Re: [Fuchu] FsCheck integration (#43)

Hi guys,

I'm running into the same error. When running with my own settings instead of FsCheck.Config.Default, my error message changes to this:

basic/Addition is commutative: Exception: System.MissingMethodException: Method 'Runner.get_init' not found. at Fuchu.Impl+evalTestList@260-1.Invoke (System.Tuple`2 tupledArg) [0x00000] in :0 (00:00:00.0003217) 1 tests run: 0 passed, 0 ignored, 0 failed, 1 errored (00:00:00.1234726)

— Reply to this email directly or view it on GitHub.

mausch commented 9 years ago

How do you install these packages? If I start a new project and install Fuchu.FsCheck I get FsCheck 1.0.4, not 2.x...

Anyway I just released Fuchu 1.0 with a dependency on FsCheck 2.1.0

christolo commented 9 years ago

I used paket and "it just worked".

lapponiandevil commented 9 years ago

I'm using paket. When I updated my nugets yesterday, Fuchu.FsCheck's dependency to FsCheck somehow got bumped to version 2.1.0. I'm unable to reproduce that now, which could be due to the of lack of tea, ibuprofen or something else. Not sure. Version 1.0 did the trick, thanks!