Skip to content

Commit d9d3901

Browse files
committed
Add test that copy/copymutable preserve type
1 parent 0f5bd4a commit d9d3901

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test/test_sorted_containers.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1720,7 +1720,13 @@ end
17201720
# Test AbstractSet/AbstractDict interface
17211721
for m in [SortedSet([1,2]), SortedDict(1=>2, 2=>3), SortedMultiDict(1=>2, 1=>3)]
17221722
# copy()
1723-
@test isequal(copy(m), m)
1724-
@test isequal(Base.copymutable(m), m)
1723+
let m1 = copy(m)
1724+
@test isequal(m1, m)
1725+
@test typeof(m1) === typeof(m)
1726+
end
1727+
let m1 = Base.copymutable(m)
1728+
@test isequal(m1, m)
1729+
@test typeof(m1) === typeof(m)
1730+
end
17251731
end
17261732
end

0 commit comments

Comments
 (0)