diff --git a/test/format-type-x-test.js b/test/format-type-x-test.js index 1b6c5d0..49bd8ed 100644 --- a/test/format-type-x-test.js +++ b/test/format-type-x-test.js @@ -50,6 +50,12 @@ tape("format(\"x\") rounds non-integers", function(test) { test.end(); }); +tape("format(\"x\") can format negative zero as zero", function(test) { + test.equal(format.format("x")(-0), "0"); + test.equal(format.format("x")(-1e-12), "0"); + test.end(); +}); + tape("format(\"x\") does not consider -0xeee to be positive", function(test) { test.equal(format.format("x")(-0xeee), "-eee"); test.end(); @@ -65,6 +71,12 @@ tape("format(\"#X\") returns the expected hexadecimal (uppercase) string with pr test.end(); }); +tape("format(\"X\") can format negative zero as zero", function(test) { + test.equal(format.format("X")(-0), "0"); + test.equal(format.format("X")(-1e-12), "0"); + test.end(); +}); + tape("format(\"X\") does not consider -0xeee to be positive", function(test) { test.equal(format.format("X")(-0xeee), "-EEE"); test.end();