We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
hash2
1 parent f02d929 commit e84a4bfCopy full SHA for e84a4bf
test/hash_consing.jl
@@ -137,3 +137,13 @@ end
137
@test x1 !== x2
138
SymbolicUtils.ENABLE_HASHCONSING[] = true
139
end
140
+
141
+@testset "`hash2` is cached" begin
142
+ @syms a b f(..)
143
+ for ex in [a + b, a * b, f(a)]
144
+ h = SymbolicUtils.hash2(ex)
145
+ @test h == ex.hash2[]
146
+ ex2 = setmetadata(ex, Int, 3)
147
+ @test ex2.hash2[] != h
148
+ end
149
+end
0 commit comments