|
1 |
| -import DataStructures: DefaultDictBase |
| 1 | +import DataStructures: DefaultDictBase, OrderedDict |
2 | 2 |
|
3 | 3 | @testset "DefaultDict" begin
|
4 | 4 |
|
@@ -26,6 +26,14 @@ import DataStructures: DefaultDictBase
|
26 | 26 | @test_throws ArgumentError DefaultDict{AbstractString, Int}()
|
27 | 27 |
|
28 | 28 | @test isa(DefaultDict(0.0, 1 => 1.0), DefaultDict{Int, Float64, Float64})
|
| 29 | + @test isa(DefaultDict(0.0, Dict(1 => 1.0)), DefaultDict{Int, Float64, Float64}) |
| 30 | + |
| 31 | + @test isa(DefaultDict{Float64, Int}(0.0), DefaultDict{Float64, Int, Float64}) |
| 32 | + @test isa(DefaultDict{Float64, Int}(0.0, Dict()), DefaultDict{Float64, Int, Float64}) |
| 33 | + @test isa(DefaultDict{Float64, Int}(0.0, OrderedDict()), DefaultDict{Float64, Int, Float64}) |
| 34 | + @test isa(DefaultDict{Float64, Int}(0.0, 1 => 1.0), DefaultDict{Float64, Int, Float64}) |
| 35 | + @test isa(DefaultDict{Float64, Int}(0.0, Dict(1 => 1.0)), DefaultDict{Float64, Int, Float64}) |
| 36 | + @test isa(DefaultDict{Float64, Int}(0.0, OrderedDict(1 => 1.0)), DefaultDict{Float64, Int, Float64}) |
29 | 37 | end
|
30 | 38 |
|
31 | 39 | @testset "Core Functionality" begin
|
@@ -132,7 +140,18 @@ import DataStructures: DefaultDictBase
|
132 | 140 | @testset "DefaultOrderedDict" begin
|
133 | 141 | @testset "construction" begin
|
134 | 142 | @test_throws ArgumentError DefaultOrderedDict()
|
| 143 | + @test_throws ArgumentError DefaultOrderedDict(AbstractString, Int) |
135 | 144 | @test_throws ArgumentError DefaultOrderedDict{AbstractString, Int}()
|
| 145 | + |
| 146 | + @test isa(DefaultOrderedDict(0.0, 1 => 1.0), DefaultOrderedDict{Int, Float64, Float64}) |
| 147 | + @test isa(DefaultOrderedDict(0.0, Dict(1 => 1.0)), DefaultOrderedDict{Int, Float64, Float64}) |
| 148 | + |
| 149 | + @test isa(DefaultOrderedDict{Float64, Int}(0.0), DefaultOrderedDict{Float64, Int, Float64}) |
| 150 | + @test isa(DefaultOrderedDict{Float64, Int}(0.0, Dict()), DefaultOrderedDict{Float64, Int, Float64}) |
| 151 | + @test isa(DefaultOrderedDict{Float64, Int}(0.0, OrderedDict()), DefaultOrderedDict{Float64, Int, Float64}) |
| 152 | + @test isa(DefaultOrderedDict{Float64, Int}(0.0, 1 => 1.0), DefaultOrderedDict{Float64, Int, Float64}) |
| 153 | + @test isa(DefaultOrderedDict{Float64, Int}(0.0, Dict(1 => 1.0)), DefaultOrderedDict{Float64, Int, Float64}) |
| 154 | + @test isa(DefaultOrderedDict{Float64, Int}(0.0, OrderedDict(1 => 1.0)), DefaultOrderedDict{Float64, Int, Float64}) |
136 | 155 | end
|
137 | 156 |
|
138 | 157 | @testset "Core Functionality" begin
|
|
0 commit comments