Skip to content

Commit

Permalink
adding test functions to check a < b or a > b
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Voigt authored and Alexander Voigt committed Jul 13, 2016
1 parent 0da15b9 commit 235d6ad
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion meta/TestSuite.m
Expand Up @@ -3,6 +3,8 @@

TestEquality::usage="tests equality of two expressions";
TestCloseRel::usage="tests relative numerical difference."
TestLowerThan::usage="tests whether a < b."
TestGreaterThan::usage="tests whether a > b."
TestNonEquality::usage="tests inequality of two expressions";
TestCPPCode::usage="tests a C/C++ code snippet for an expected
result";
Expand Down Expand Up @@ -93,7 +95,21 @@
MapThread[TestCloseRel[#1,#2,rel]&, {Flatten[a], Flatten[b]}];

TestCloseRel[a___] := (
Print["FAIL: ", {a}];
Print["TestCloseRel: FAIL: ", {a}];
TestEquality[0,1]);

TestLowerThan[a_?NumericQ, b_?NumericQ] :=
TestEquality[a < b, True];

TestLowerThan[a___] := (
Print["TestLowerThan: FAIL: ", {a}];
TestEquality[0,1]);

TestGreaterThan[a_?NumericQ, b_?NumericQ] :=
TestEquality[a > b, True];

TestGreaterThan[a___] := (
Print["TestGreaterThan: FAIL: ", {a}];
TestEquality[0,1]);

End[];
Expand Down

0 comments on commit 235d6ad

Please sign in to comment.