Skip to content

Commit ba863c5

Browse files
test: update codegen tests
1 parent bf23a1d commit ba863c5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/code.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,18 +101,18 @@ nanmath_st.rewrites[:nanmath] = true
101101

102102
@test toexpr(a^2) == :($(^)(a, 2))
103103
@test toexpr(a^2, nanmath_st) == :($(NaNMath.pow)(a, 2))
104-
@test toexpr(NaNMath.pow(a, 2)) == :($(NaNMath.pow)(a, 2))
104+
@test toexpr(NaNMath.pow(a, 2)) == :($(^)(a, 2))
105105
@test toexpr(NaNMath.pow(a, 2), nanmath_st) == :($(NaNMath.pow)(a, 2))
106106

107107
@test toexpr(a^-1) == :($(/)(1, a))
108108
@test toexpr(a^-1, nanmath_st) == :($(/)(1, a))
109-
@test toexpr(NaNMath.pow(a, -1)) == :($(NaNMath.pow)(a, -1))
110-
@test toexpr(NaNMath.pow(a, -1), nanmath_st) == :($(NaNMath.pow)(a, -1))
109+
@test toexpr(NaNMath.pow(a, -1)) == :($(inv)(a))
110+
@test toexpr(NaNMath.pow(a, -1), nanmath_st) == :($(inv)(a))
111111

112112
@test toexpr(a^-2) == :($(/)(1, $(^)(a, 2)))
113113
@test toexpr(a^-2, nanmath_st) == :($(/)(1, $(NaNMath.pow)(a, 2)))
114-
@test toexpr(NaNMath.pow(a, -2)) == :($(NaNMath.pow)(a, -2))
115-
@test toexpr(NaNMath.pow(a, -2), nanmath_st) == :($(NaNMath.pow)(a, -2))
114+
@test toexpr(NaNMath.pow(a, -2)) == :($(NaNMath.pow)($(inv)(a), 2))
115+
@test toexpr(NaNMath.pow(a, -2), nanmath_st) == :($(NaNMath.pow)($(inv)(a), -2))
116116

117117
f = GlobalRef(NaNMath, :sin)
118118
test_repr(toexpr(LiteralExpr(:(let x=1, y=2

0 commit comments

Comments
 (0)