Bot releases are visible (Hide)
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!
Published by haf almost 8 years ago
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
Published by haf almost 8 years ago
In this release @MNie has added string diff support!
It looks like this:
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.
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.
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.
f
, like ftestCase
Cred to you guys!
Henrik
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
]
Published by haf almost 8 years ago
This is the official release of Expecto.
Highlights:
Working towards:
Message
that then can be nicely formatted and printedequal
expectation function