Mercurial > repos > public > sbplib_julia
changeset 740:e7e06bf394fb feature/static_dict
Add tests for length
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 17 Mar 2021 21:57:55 +0100 |
parents | e716602f1d62 |
children | 94941a062124 |
files | test/testStaticDicts.jl |
diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/test/testStaticDicts.jl Wed Mar 17 21:56:55 2021 +0100 +++ b/test/testStaticDicts.jl Wed Mar 17 21:57:55 2021 +0100 @@ -21,12 +21,17 @@ @test_throws DomainError StaticDict(1=>3, 1=>3) end + @testset "length" begin + @test length(StaticDict()) == 0 + @test length(StaticDict(1=>1)) == 1 + @test length(StaticDict(1=>1, 2=>2)) == 2 + end + @testset "equality" begin @test StaticDict(1=>1) == StaticDict(1=>1) @test StaticDict(2=>1) != StaticDict(1=>1) @test StaticDict(1=>2) != StaticDict(1=>1) - # The following is not true for the regular Dict @test StaticDict(1=>1) === StaticDict(1=>1) @test StaticDict(2=>1) !== StaticDict(1=>1)