Skip to content
Release with confidence, state-of-the-art property testing for .NET.
Branch: master
Clone or download
Latest commit d2fa38d Mar 22, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
.paket Update Paket Apr 2, 2018
doc Minor typo fix: "shrikning" -> "shrinking" Oct 5, 2017
img Update logo Mar 22, 2019
tests fix for generating out-of-range values, Jul 27, 2018
.gitignore Ignore .vs folder Nov 3, 2017
.travis.yml Change Travis to build Release Feb 7, 2018 Release 0.8.2 Aug 6, 2018
Hedgehog.sln Attempted fix for metaproj error Feb 7, 2018
LICENSE Add co-author name on the LICENSE, Dec 3, 2016
paket.dependencies add the frameowork restrict Jul 3, 2018
paket.lock execute packet to apply changes Jul 3, 2018 Ignore 'img' directory when checking for line endings Nov 19, 2016

fsharp-hedgehog NuGet Travis

Hedgehog will eat all your bugs.

Hedgehog is a modern property-based testing system, in the spirit of QuickCheck. Hedgehog uses integrated shrinking, so shrinks obey the invariants of generated values by construction.


  • Integrated shrinking, shrinks obey invariants by construction.
  • Convenient syntax for generators and properties with gen and property expressions.
  • Range combinators for full control over the scope of generated numbers and collections.


The root namespace, Hedgehog, includes almost everything you need to get started writing property tests with Hedgehog.

open Hedgehog

Once you have your import declaration set up, you can write a simple property:

let propReverse : Property<Unit> =
    property {
        let! xs = Gen.list (Range.linear 0 100) Gen.alpha
        return xs |> List.rev |> List.rev = xs

You can then load the module in F# Interactive, and run it:

> Property.print propReverse
+++ OK, passed 100 tests.

More examples can be found in the tutorial.

Building from source

To build Hedgehog from source, you will need either the .NET Core SDK or Visual Studio.


If you are using Linux you will also need Mono installed (in order to run Paket). The full install sequence (for Ubuntu) will be something like this.

Building & running tests

With Visual Studio you can build Hedgehog and run the tests from inside the IDE, otherwise with the dotnet command-line tool you can execute:

dotnet build

The first time you run it, this will use Paket to restore all the packages, and then build the code.

To run the tests, you can execute:

dotnet test tests/Hedgehog.Tests/Hedgehog.Tests.fsproj
dotnet test tests/Hedgehog.CSharp.Tests/Hedgehog.CSharp.Tests.csproj

Building the NuGet package

After building the source (for release configuration, i.e. dotnet build -c Release), you can produce the NuGet package with Paket:

.paket/paket.exe pack src/Hedgehog

This will produce Hedgehog-x.y.z.w.nupkg in src/Hedgehog.

You can’t perform that action at this time.