MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_other

Function test_other

extra_tests/snippets/builtin_pow.py:90–112  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

88
89
90def test_other():
91 # Other tests-- not very systematic
92 assert_equal(pow(3, 3) % 8, pow(3, 3, 8))
93 assert_equal(pow(3, 3) % -8, pow(3, 3, -8))
94 assert_equal(pow(3, 2) % -2, pow(3, 2, -2))
95 assert_equal(pow(-3, 3) % 8, pow(-3, 3, 8))
96 assert_equal(pow(-3, 3) % -8, pow(-3, 3, -8))
97 assert_equal(pow(5, 2) % -8, pow(5, 2, -8))
98
99 assert_equal(pow(3, 3) % 8, pow(3, 3, 8))
100 assert_equal(pow(3, 3) % -8, pow(3, 3, -8))
101 assert_equal(pow(3, 2) % -2, pow(3, 2, -2))
102 assert_equal(pow(-3, 3) % 8, pow(-3, 3, 8))
103 assert_equal(pow(-3, 3) % -8, pow(-3, 3, -8))
104 assert_equal(pow(5, 2) % -8, pow(5, 2, -8))
105
106 for i in range(-10, 11):
107 for j in range(0, 6):
108 for k in range(-7, 11):
109 if j >= 0 and k != 0:
110 assert_equal(pow(i, j) % k, pow(i, j, k))
111 if j >= 0 and k != 0:
112 assert_equal(pow(int(i), j) % k, pow(int(i), j, k))
113
114
115def test_bug643260():

Callers

nothing calls this directly

Calls 2

assert_equalFunction · 0.90
powFunction · 0.50

Tested by

no test coverage detected