From e7937959052ff2df817b599db92ac4eaf9a61786 Mon Sep 17 00:00:00 2001 From: Benjamin Morel Date: Tue, 24 Dec 2019 14:31:09 +0100 Subject: [PATCH] Add tests Trying out mutation testing (infection). --- tests/BigDecimalTest.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/BigDecimalTest.php b/tests/BigDecimalTest.php index 48482d3..9f5a437 100644 --- a/tests/BigDecimalTest.php +++ b/tests/BigDecimalTest.php @@ -288,6 +288,12 @@ public function providerOfUnscaledValue() ]; } + public function testOfUnscaledValueWithDefaultScale() + { + $number = BigDecimal::ofUnscaledValue('123456789'); + $this->assertBigDecimalInternalValues('123456789', 0, $number); + } + /** * @expectedException \InvalidArgumentException */ @@ -633,6 +639,11 @@ public function providerMultipliedBy() ['123.00', '999.0', '122877000', 3], ['123.00', '999.00', '1228770000', 4], + ['123.0', '0.1', '1230', 2], + ['123.0', '0.01', '1230', 3], + ['123.1', '0.01', '1231', 3], + ['123.1', '0.001', '1231', 4], + ['123', '-999', '-122877', 0], ['123', '-999.0', '-1228770', 1], ['123', '-999.00', '-12287700', 2],