You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
to compare the expected and actual values of Strings.
I am missing similar Asserts for other types than String.
This can be solved by a generic specified as
generic
type Element_T is (<>);
procedure Generic_Assert
(Actual : Element_T;
Expected : Element_T;
Message : String;
Source : String := GNAT.Source_Info.File;
Line : Natural := GNAT.Source_Info.Line);
-- Specialized versions of Assert, they call the general version that
-- takes a Condition as a parameter
Dear AUnit developers,
AUnit provides
aunit/include/aunit/framework/aunit-assertions.adb
Line 99 in 552a240
to compare the expected and actual values of
String
s.I am missing similar
Assert
s for other types thanString
.This can be solved by a generic specified as
and implemented as
and use it as follows
With Ada2020, the generic can even be made more general, since Image is defined on more types.
Could you consider adding this functionality to AUnit?
Since it will make my test cases shorter, clearer and easier to read.
Greetings,
Pierre
The text was updated successfully, but these errors were encountered: