| 1 | import math |
| 2 | |
| 3 | fn test_square() { |
| 4 | assert math.square(0) == 0 |
| 5 | assert math.square(1) == 1 |
| 6 | assert math.square(-1) == 1 |
| 7 | assert math.square(5) == 25 |
| 8 | assert math.square(u8(3)) == 9 |
| 9 | assert math.square(u32(10)) == 100 |
| 10 | assert math.square(-7) == 49 |
| 11 | } |
| 12 | |
| 13 | fn test_cube() { |
| 14 | assert math.cube(0) == 0 |
| 15 | assert math.cube(1) == 1 |
| 16 | assert math.cube(-1) == -1 |
| 17 | assert math.cube(5) == 125 |
| 18 | assert math.cube(u8(3)) == 27 |
| 19 | assert math.cube(u32(10)) == 1000 |
| 20 | assert math.cube(-7) == -343 |
| 21 | } |
| 22 | |