|
1 | 1 | from __future__ import annotations |
2 | 2 |
|
3 | 3 | import pytest |
4 | | -from chia_rs import ENABLE_FIXED_DIV |
5 | 4 | from clvm.EvalError import EvalError |
6 | 5 | from clvm.operators import KEYWORD_TO_ATOM |
7 | 6 | from clvm_tools.binutils import assemble, disassemble |
@@ -120,27 +119,32 @@ def test_run() -> None: |
120 | 119 | assert ret.atom == bytes([0xFE]) |
121 | 120 |
|
122 | 121 | # run() |
123 | | - with pytest.raises(ValueError, match="div operator with negative operands is deprecated"): |
124 | | - cost, ret = div.run_with_cost(100000, [10, -5], 0) |
| 122 | + cost, ret = div.run_with_cost(100000, [10, -5], 0) |
| 123 | + assert cost == 1107 |
| 124 | + print(ret) |
| 125 | + assert ret.atom == bytes([0xFE]) |
125 | 126 |
|
126 | | - cost, ret = div.run_with_cost(100000, [10, -5], ENABLE_FIXED_DIV) |
| 127 | + cost, ret = div.run_with_cost(100000, [10, -5], 0) |
127 | 128 | assert cost == 1107 |
128 | 129 | print(ret) |
129 | 130 | assert ret.atom == bytes([0xFE]) |
130 | 131 |
|
131 | 132 | # run_with_flags() |
132 | | - with pytest.raises(ValueError, match="div operator with negative operands is deprecated"): |
133 | | - cost, ret = div.run_with_flags(100000, 0, [10, -5]) |
| 133 | + cost, ret = div.run_with_flags(100000, 0, [10, -5]) |
| 134 | + assert cost == 1107 |
| 135 | + print(ret) |
| 136 | + assert ret.atom == bytes([0xFE]) |
134 | 137 |
|
135 | | - cost, ret = div.run_with_flags(100000, ENABLE_FIXED_DIV, [10, -5]) |
| 138 | + cost, ret = div.run_with_flags(100000, 0, [10, -5]) |
136 | 139 | assert cost == 1107 |
137 | 140 | print(ret) |
138 | 141 | assert ret.atom == bytes([0xFE]) |
139 | 142 |
|
140 | 143 | # run_with_cost() |
141 | | - with pytest.raises(ValueError, match="div operator with negative operands is deprecated"): |
142 | | - ret = div.run([10, -5], 100000, 0) |
| 144 | + ret = div.run([10, -5], 100000, 0) |
| 145 | + print(ret) |
| 146 | + assert ret.atom == bytes([0xFE]) |
143 | 147 |
|
144 | | - ret = div.run([10, -5], 100000, ENABLE_FIXED_DIV) |
| 148 | + ret = div.run([10, -5], 100000, 0) |
145 | 149 | print(ret) |
146 | 150 | assert ret.atom == bytes([0xFE]) |
0 commit comments