diff options
author | Ian Hinder <ian.hinder@aei.mpg.de> | 2012-11-14 14:20:01 +0100 |
---|---|---|
committer | Ian Hinder <ian.hinder@aei.mpg.de> | 2012-11-14 14:20:01 +0100 |
commit | b9280913eee47678930b6682319bd045136d3793 (patch) | |
tree | 2f09712dfe2d3b476a1438a521be7fa5b31e6c9c /Tests | |
parent | f6831665e94e660cd2aeec1c42b77bddfacb6d58 (diff) |
TestTensorTools.m: Improve report of tests passed and failed
Diffstat (limited to 'Tests')
-rwxr-xr-x | Tests/TestTensorTools.m | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Tests/TestTensorTools.m b/Tests/TestTensorTools.m index 4fd7bef..13b21e2 100755 --- a/Tests/TestTensorTools.m +++ b/Tests/TestTensorTools.m @@ -49,12 +49,14 @@ test[t_, r1_] := Print["Fail"]]; Print[]]; +count[num_Integer, noun_String] := + ToString[num] <> " " <> noun <> If[num === 1, "", "s"]; + reportResults[] := - If[testsFailed > 0, - Print[ToString[testsFailed] <> " test" <> - If[testsFailed > 1, "s", ""] <> " failed"], - Print["All " <> ToString[testsPassed] <> " test" <> - If[testsPassed > 1, "s", ""] <> " passed"]]; + Module[ + {}, + Print[count[testsPassed, "test"], " passed"]; + Print[count[testsFailed, "test"], " failed"]]; (****************************************************************) (* Tests *) |