diff --git a/largest-series-product/series_product.t b/largest-series-product/series_product.t index 595b3e71..b3c8041e 100644 --- a/largest-series-product/series_product.t +++ b/largest-series-product/series_product.t @@ -28,4 +28,9 @@ is $module->new('0123456789')->largest_product(2), 72, "largest product of 2"; is $module->new('19')->largest_product(2), 9, "largest product of 2 on a tiny number"; is $module->new('1027839564')->largest_product(3), 270, "largest product of 3"; is $module->new('52677741234314237566414902593461595376319419139427')->largest_product(6), 28350, "largest product of 6"; -is $module->new('')->largest_product(0), 1, "test identity"; +is $module->new('0000')->largest_product(2), 0, "test string containing only zeroes"; +is $module->new('99099')->largest_product(3), 0, "test string where all products are zero"; +is $module->new('')->largest_product(0), 1, "test identity with empty string"; +is $module->new('123')->largest_product(0), 1, "test identity with non-empty string"; + +throws_ok { $module->new('')->largest_product(1) } qr/ArgumentError/, "non-zero slice length with empty string throws exception";