Skip to content

Commit b4d45b1

Browse files
committed
Add array assertions for unary ops
Extend tests in tests/test_expr.py to verify elementwise behavior of unary functions with array inputs. Added assert all(...) checks for sqrt, exp, log, sin, and cos comparing results to numpy equivalents to ensure these functions handle array inputs correctly.
1 parent 55c1343 commit b4d45b1

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

tests/test_expr.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,15 @@ def test_unary(model):
250250
assert str(np.log([x, y])) == res
251251

252252
assert sqrt(4) == np.sqrt(4)
253+
assert all(sqrt([4, 4]) == np.sqrt([4, 4]))
253254
assert exp(3) == np.exp(3)
255+
assert all(exp([3, 3]) == np.exp([3, 3]))
254256
assert log(5) == np.log(5)
257+
assert all(log([5, 5]) == np.log([5, 5]))
255258
assert sin(1) == np.sin(1)
259+
assert all(sin([1, 1]) == np.sin([1, 1]))
256260
assert cos(1) == np.cos(1)
261+
assert all(cos([1, 1]) == np.cos([1, 1]))
257262

258263

259264
def test_mul():

0 commit comments

Comments
 (0)