diff options
author | P. J. McDermott <pj@pehjota.net> | 2017-01-07 05:14:48 (EST) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2017-01-07 05:14:48 (EST) |
commit | d3e090cb289698d6f7fca55b89ce92fbc1832cc6 (patch) | |
tree | 4a04c291128d398bef17240d9e7883f01e34b7a3 | |
parent | 70efc7b6cd66d4aaabb45f5adca928d45324f2cf (diff) | |
download | decmath.js-d3e090cb289698d6f7fca55b89ce92fbc1832cc6.zip decmath.js-d3e090cb289698d6f7fca55b89ce92fbc1832cc6.tar.gz decmath.js-d3e090cb289698d6f7fca55b89ce92fbc1832cc6.tar.bz2 |
test/13_drhtz-drhfz.js: Differentiate between drhtz() and drhfz()
-rw-r--r-- | test/13_drhtz-drhfz.js | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/test/13_drhtz-drhfz.js b/test/13_drhtz-drhfz.js index b2067c9..32e314c 100644 --- a/test/13_drhtz-drhfz.js +++ b/test/13_drhtz-drhfz.js @@ -47,7 +47,16 @@ describe("drhtz() and drhfz()", function() { ]; tests.forEach(function(test) { test.slice(3).forEach(function(f) { - it("correctly round " + test[0] + + var rule; + switch (f) { + case drhtz: + rule = "toward zero"; + break; + case drhfz: + rule = "away from zero"; + break; + } + it("correctly round " + rule + " " + test[0] + " with precision " + test[1] + " to " + test[2], function() { assert.equal( @@ -71,7 +80,16 @@ describe("drhtz() and drhfz()", function() { ]; tests.forEach(function(test) { test.slice(3).forEach(function(f) { - it("correctly round " + test[0] + + var rule; + switch (f) { + case drhtz: + rule = "toward zero"; + break; + case drhfz: + rule = "away from zero"; + break; + } + it("correctly round " + rule + " " + test[0] + " with precision " + test[1] + " to " + test[2], function() { assert.equal( @@ -88,7 +106,16 @@ describe("drhtz() and drhfz()", function() { ]; tests.forEach(function(test) { test.slice(3).forEach(function(f) { - it("correctly round " + test[0] + + var rule; + switch (f) { + case drhtz: + rule = "toward zero"; + break; + case drhfz: + rule = "away from zero"; + break; + } + it("correctly round " + rule + " " + test[0] + " with precision " + test[1] + " to " + test[2], function() { assert.equal( |