expecto

A smooth testing lib for F#. APIs made for humans! Strong testing methodologies for everyone!

APACHE-2.0 License

Stars
651
Committers
66

Bot releases are hidden (Show)

expecto - v2.4.0 – Welch's T-test statistical performance testing

Published by haf almost 8 years ago

I'm happy to release another minor version of Expecto with a new performance-test feature – namely Expect.isFasterThan.

Don't let the name mislead you. It's actually a more profound test that builds on Student's T-test by using Welch's T-test for validating the hypothesis that the two passed functions are equally fast. Here's a sample:


    testSequenced (testCase "matrix" <| fun _ ->
      let n = 100
      let rand = Random 123
      let a = Array2D.init n n (fun _ _ -> rand.NextDouble())
      let b = Array2D.init n n (fun _ _ -> rand.NextDouble())
      let c = Array2D.zeroCreate n n

      let reset() =
        for i = 0 to n-1 do
            for j = 0 to n-1 do
              c.[i,j] <- 0.0

      let mulIJK() =
        for i = 0 to n-1 do
          for j = 0 to n-1 do
            for k = 0 to n-1 do
              c.[i,k] <- c.[i,k] + a.[i,j] * b.[j,k]

      let mulIKJ() =
        for i = 0 to n-1 do
          for k = 0 to n-1 do
            let mutable t = 0.0
            for j = 0 to n-1 do
              t <- t + a.[i,j] * b.[j,k]
            c.[i,k] <- t
      Expect.isFasterThanSub (fun measurer -> reset(); measurer mulIKJ ())
                             (fun measurer -> reset(); measurer mulIJK ())
                             "ikj faster than ijk")

More information about this feature can be found in the docs.

A big thanks to @AnthonyLloyd for contributing this code!

Happy performance testing!

expecto - v2.3.1 – bugfixes

Published by haf almost 8 years ago

expecto - v2.3.0 – improved printouts, containsAll function, internal tests

Published by haf almost 8 years ago

In this release I give you an improved containsAll and better string diff messages. Thanks to @MNie for his contributions again!

If you're thinking of contributing, you'll be happy to know, it's even easier to do now, since I've improved the internal tests (very meta).

/Henrik

expecto - v2.2.0 - String diffing!

Published by haf almost 8 years ago

In this release @MNie has added string diff support!

It looks like this:

string-diff-support

expecto - v2.1.1 – Bugfix release for summary/exit code

Published by haf almost 8 years ago

#29 fixed a bug that was introduced #19. Issues #23 #24 were created as a result and are now marked resolved.

expecto - v2.1.0 – `--summary`, assertion lib improvements

Published by haf almost 8 years ago

The v2.1.0 release comes with a nifty ability to print a summary of the tests run, thanks to the work of @Krzysztof-Cieslak. Just pass --summary to your executable to get it printed at the end of the test suite run.

Use v2.1.1 from nuget instead of v2.1.0.

expecto - v2.0 - filtering support, focus support, equality messages

Published by haf almost 8 years ago

I'm happy to announce a new major release of Expecto. This release contains many improvements for great good!

This release was made possible through the work of the following people.

  • @cloudRoutine – initial work towards .Net core
  • @MecuSorin – support focusing on tests during development by prefixing f, like ftestCase
  • @Krzysztof-Cieslak – better diff messages for string
  • @Krzysztof-Cieslak – support for listing tests and filtering them via test parameters
  • @fbehrens – documentation improvements

Cred to you guys!

Henrik

expecto - v1.1.0 – Expecto.BenchmarkDotNet

Published by haf almost 8 years ago

This release marks the initial support for benchmark dot net.

Sample usage:

module Expecto.BenchmarkDotNetTests

open System
open System.Security.Cryptography
open Expecto
open BenchmarkDotNet

type Md5VsSha256() =
  let data : byte[] = Array.zeroCreate 10000
  do Random(42).NextBytes data

  let md5, sha256 = MD5.Create(), SHA256.Create()

  [<Benchmark>]
  member x.Sha256() = sha256.ComputeHash data
  [<Benchmark>]
  member x.Md5() = md5.ComputeHash(data)

[<Tests>]
let benchmarks =
  testList "some different benchmarks" [
    benchmark<Md5VsSha256> "md5 versus sha256" benchmarkConfig ignore
  ]
expecto - v1.0.12 – official release

Published by haf almost 8 years ago

This is the official release of Expecto.

Highlights:

  • Nicely coloured output
  • Parallel by default
  • Expect, the assertion/expectation module has been extended with many functions for asserting

Working towards:

  • All test failures should contain a Message that then can be nicely formatted and printed
  • Adding diffing support to longer structures, especially for the equal expectation function
  • Finding where FsCheck prints its 100 tests passed from and moving it towards the printing infrastructure