Skip to content

Bug in OrderedDict (unlike in LittleDict, and Dict) #65

@PallHaraldsson

Description

@PallHaraldsson

Copied the test from Base, where with Dict is ok, here renamed to OrderedDict not:

using Tests
@testset "shallow and deep copying" begin
           a = Any[[1]]
           q = QuoteNode([1])
           ca = copy(a); dca = @inferred(deepcopy(a))
           @test ca !== a
           @test ca[1] === a[1]
           @test dca !== a
           @test dca[1] !== a[1]
           @test deepcopy(q).value !== q.value
       
           @test_throws ErrorException("deepcopy of Modules not supported") deepcopy(Base)
       
           # deepcopy recursive dicts
           x = OrderedDict{OrderedDict, Int}()
           x[x] = 0
           @test length(deepcopy(x)) == 1
       end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions