@@ -26,42 +26,42 @@ include("test_params.jl")
2626 @test tree. l. l === tree. r
2727 @test hash (tree. l. l) == hash (tree. r)
2828
29- # When we copy with the normal copy, the topology breaks:
30- copy_without_topology = copy_node (tree)
31- @test ! (copy_without_topology . l. l === copy_without_topology . r)
29+ # When we copy with the normal copy, the sharing breaks:
30+ copy_without_sharing = copy_node (tree)
31+ @test ! (copy_without_sharing . l. l === copy_without_sharing . r)
3232
33- # But with the topology preserved in the copy, it should be the same:
34- copy_with_topology = copy_node (tree; preserve_topology = true )
35- @test copy_with_topology . l. l === copy_with_topology . r
33+ # But with the sharing preserved in the copy, it should be the same:
34+ copy_with_sharing = copy_node (tree; preserve_sharing = true )
35+ @test copy_with_sharing . l. l === copy_with_sharing . r
3636
3737 # We can also tweak the new tree, and the edits should be propagated:
38- copied_base_tree = copy_with_topology . l. l
38+ copied_base_tree = copy_with_sharing . l. l
3939 # (First, assert that it is the same as the old base tree)
4040 @test string_tree (copied_base_tree, operators) == string_tree (base_tree, operators)
4141
4242 # Now, let's tweak the new tree's base tree:
4343 copied_base_tree. l. l = x1 * x2 * 5.2 - exp (x3)
4444 # "exp" should appear *twice* now:
45- copy_with_topology
46- @test length (collect (eachmatch (r" exp" , string_tree (copy_with_topology , operators)))) ==
45+ copy_with_sharing
46+ @test length (collect (eachmatch (r" exp" , string_tree (copy_with_sharing , operators)))) ==
4747 2
48- @test copy_with_topology . l. l === copy_with_topology . r
49- @test hash (copy_with_topology . l. l) == hash (copy_with_topology . r)
50- @test string_tree (copy_with_topology . l. l, operators) !=
48+ @test copy_with_sharing . l. l === copy_with_sharing . r
49+ @test hash (copy_with_sharing . l. l) == hash (copy_with_sharing . r)
50+ @test string_tree (copy_with_sharing . l. l, operators) !=
5151 string_tree (base_tree, operators)
5252
5353 # We also test whether `convert` breaks shared children.
5454 # The node type here should be Float64.
5555 @test typeof (tree). parameters[1 ] == Float64
5656 # Let's convert to Float32:
57- float32_tree = convert (Node{Float32}, tree; preserve_topology = true )
57+ float32_tree = convert (Node{Float32}, tree; preserve_sharing = true )
5858 @test typeof (float32_tree). parameters[1 ] == Float32
5959 # The linkage should be kept:
6060 @test float32_tree. l. l === float32_tree. r
6161end
6262
6363# We also do tests of the macros related to generating functions that preserve
64- # topology :
64+ # sharing :
6565expr_eql (x:: LineNumberNode , y:: LineNumberNode ) = true # Ignore line numbers
6666expr_eql (x:: QuoteNode , y:: QuoteNode ) = x == y
6767expr_eql (x:: Number , y:: Number ) = x == y
0 commit comments