diff --git a/test/ArrayDictionary.jl b/test/ArrayDictionary.jl index 75d81b7..668f72d 100644 --- a/test/ArrayDictionary.jl +++ b/test/ArrayDictionary.jl @@ -40,14 +40,9 @@ @test !isempty(d) @test isequal(copy(d), d) @test_throws IndexError insert!(d, 10, 12) - @test d[10] == 11 - set!(d, 10, 12) - @test length(d) == setwith!(+, d, 10.0, 2.0) + @test d[10.0] == 11 + set!(d, 10.0, 12.0) @test length(d) == 1 - @test d[10] == 14 - setwith!(+, d, 2.0, 2.0) - @test length(d) == 2 - @test d[2] == 2 @test d[10] == 12 setwith!(+, d, 10.0, 2.0) @test length(d) == 1 @@ -55,8 +50,9 @@ setwith!(+, d, 2.0, 2.0) @test length(d) == 2 @test d[2] == 2 - d[10] = 13 - @test length(d) == 2 + delete!(d, 2) + @test length(d) == 1 + d[10.0] = 13.0 @test d[10] == 13 io = IOBuffer(); print(io, d); @test String(take!(io)) == "{10 = 13}" if VERSION < v"1.6-" diff --git a/test/Dictionary.jl b/test/Dictionary.jl index d06e85f..87085ed 100644 --- a/test/Dictionary.jl +++ b/test/Dictionary.jl @@ -100,8 +100,9 @@ setwith!(+, d, 2.0, 2.0) @test length(d) == 2 @test d[2] == 2 + delete!(d, 2) + @test length(d) == 1 d[10.0] = 13.0 - @test length(d) == 2 @test d[10] == 13 io = IOBuffer(); print(io, d); @test String(take!(io)) == "{10 = 13}" if VERSION < v"1.6-" diff --git a/test/UnorderedDictionary.jl b/test/UnorderedDictionary.jl index db7947e..58f3b5e 100644 --- a/test/UnorderedDictionary.jl +++ b/test/UnorderedDictionary.jl @@ -78,8 +78,9 @@ setwith!(+, d, 2.0, 2.0) @test length(d) == 2 @test d[2] == 2 + delete!(d, 2) + @test length(d) == 1 d[10.0] = 13.0 - @test length(d) == 2 @test d[10] == 13 io = IOBuffer(); print(io, d); @test String(take!(io)) == "{10 = 13}" if VERSION < v"1.6-"