Closed sporring closed 8 months ago
I'm not sure what error you're running into. The behavior seems the same to me.
This works
open Expecto
open Expecto.Flip
let simpleTest =
testCase "A simple test" <| fun () ->
(2+2) |>Expect.equal "2+2 = 4" 4
simpleTest |> runTestsWithCLIArgs [] [||]
Only Expect
methods have flip variants, and all they do is accept parameters in reverse order then forward them to the non-flipped version.
Perhaps you accidently removed the testCase "A simple test" <| fun () ->
line when you tried rewriting for Expecto.Flip
?
Edit: I ran these samples using interactive notebooks
Hi, I'm considering using Expecto to teach 1st year computer scientists how to perform tests. I noticed that runTestsWithCLIArgs behaves differently in Expecto and Expecto.Flip. Using a variant of the demo example in README.md, in interactive mode the following works:
but it doesn't when using Expecto.Flip, in which case the tests must be gathered as test:
Is there a deeper rationale behind this difference? Thanks, Jon