def test_modulo(): assert modulo(-1, 3) == 2 assert modulo(0, 3) == 0 assert modulo(1, 3) == 1 assert modulo(2, 3) == 2 assert modulo(3, 3) == 0 x = 3.123 assert modulo(3.123, 3) == x - 3
def test_modulo_2(): assert modulo(0, 1, 13) == 12 for i in range(1, 13): assert modulo(i, 1, 13) == i assert modulo(13, 1, 13) == 1