From 529ba64c7ba3e24151551420696c14fa3e6d2e7d Mon Sep 17 00:00:00 2001 From: fdai7764 Date: Sat, 27 Jan 2024 15:39:53 +0100 Subject: [PATCH] added test to use sqrt_power with negative number as exponent --- src/test/py/test_calculations_with_roots.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/test/py/test_calculations_with_roots.py b/src/test/py/test_calculations_with_roots.py index 7bb2c54..468ee72 100644 --- a/src/test/py/test_calculations_with_roots.py +++ b/src/test/py/test_calculations_with_roots.py @@ -30,5 +30,7 @@ class calculationsWithRoots(unittest.TestCase): def test_sqrt_16_to_power_of_0_should_be_1(self): self.assertEqual(sqrt_power(16, 0), 1) + def test_sqrt_4_to_power_of_negative_3_should_be_one_eighth(self): + self.assertEqual(sqrt_power(4, -3), 0.125) if __name__ == '__main__': unittest.main()