Skip to content

Commit

Permalink
Update Expect.fs
Browse files Browse the repository at this point in the history
Add friendly messages for isTrue and isFalse. Also reword notEqual.
  • Loading branch information
isaacabraham authored Jan 24, 2017
1 parent 447cd48 commit 56893c2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Expecto/Expect.fs
Original file line number Diff line number Diff line change
Expand Up @@ -180,20 +180,20 @@ let inline equal (actual : 'a) (expected : 'a) format =
/// Expects the two values not to equal each other.
let notEqual (actual : 'a) (expected : 'a) format =
if expected = actual then
Tests.failtestf "%s. Actual value was equal to %A but had expected it non-equal."
Tests.failtestf "%s. Actual value was equal to %A but had expected them to be non-equal."
format actual

/// Expects the value to be false.
let isFalse actual format =
if not actual then ()
else
Tests.failtest format
Tests.failtestf "%s. Actual value was true but had expected it to be false." format

/// Expects the value to be true.
let isTrue actual format =
if actual then ()
else
Tests.failtest format
Tests.failtestf "%s. Actual value was false but had expected it to be true." format

/// Expects the `sequence` to contain the `element`.
let contains sequence element format =
Expand Down Expand Up @@ -464,4 +464,4 @@ let isFasterThanSub (f1:Performance.Measurer<_,_>->'a) (f2:Performance.Measurer<
let isFasterThan (f1:unit->'a) (f2:unit->'a) format =
isFasterThanSub (fun measurer -> measurer f1 ())
(fun measurer -> measurer f2 ())
format
format

0 comments on commit 56893c2

Please sign in to comment.