aboutsummaryrefslogtreecommitdiff
path: root/Tests
diff options
context:
space:
mode:
authorIan Hinder <ian.hinder@aei.mpg.de>2012-11-14 14:20:01 +0100
committerIan Hinder <ian.hinder@aei.mpg.de>2012-11-14 14:20:01 +0100
commitb9280913eee47678930b6682319bd045136d3793 (patch)
tree2f09712dfe2d3b476a1438a521be7fa5b31e6c9c /Tests
parentf6831665e94e660cd2aeec1c42b77bddfacb6d58 (diff)
TestTensorTools.m: Improve report of tests passed and failed
Diffstat (limited to 'Tests')
-rwxr-xr-xTests/TestTensorTools.m12
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 *)