File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -689,9 +689,9 @@ defmodule ExUnit.Assertions do
689689 message =
690690 message ||
691691 "Expected the difference between #{ inspect ( value1 ) } and " <>
692- "#{ inspect ( value2 ) } (#{ inspect ( diff ) } ) to be less than #{ inspect ( delta ) } "
692+ "#{ inspect ( value2 ) } (#{ inspect ( diff ) } ) to be less than or equal to #{ inspect ( delta ) } "
693693
694- assert diff < delta , message
694+ assert diff <= delta , message
695695 end
696696
697697 @ doc """
Original file line number Diff line number Diff line change @@ -667,11 +667,16 @@ defmodule ExUnit.AssertionsTest do
667667 end
668668 end
669669
670+ test "assert in delta works with equal values and a delta of zero" do
671+ assert_in_delta ( 10 , 10 , 0 )
672+ end
673+
670674 test "assert in delta error" do
671675 "This should never be tested" = assert_in_delta ( 10 , 12 , 1 )
672676 rescue
673677 error in [ ExUnit.AssertionError ] ->
674- "Expected the difference between 10 and 12 (2) to be less than 1" = error . message
678+ "Expected the difference between 10 and 12 (2) to be less than or equal to 1" =
679+ error . message
675680 end
676681
677682 test "assert in delta with message" do
You can’t perform that action at this time.
0 commit comments