Skip to content

Commit

Permalink
More tests for ObjectIdDict
Browse files Browse the repository at this point in the history
Adding in @StefanKarpinsky and @yuyichao suggestions.
  • Loading branch information
kshyatt committed Dec 9, 2016
1 parent ae1b30b commit 8ce9f3f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/dict.jl
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,12 @@ let
@test isempty(sa)
@test isa(sa, ObjectIdDict)

@test length(a) == 2
@test 1 in keys(a)
@test a in keys(a)
@test a[1] === a
@test a[a] === 2

ca = copy(a)
@test length(ca) == length(a)
@test ca == a
Expand All @@ -395,6 +401,9 @@ let
@test length(a) == 2
end

@test length(ObjectIdDict(1=>2, 1.0=>3)) == 2
@test length(Dict(1=>2, 1.0=>3)) == 1

let d = @inferred ObjectIdDict(i=>i for i=1:3)
@test isa(d, ObjectIdDict)
@test d == ObjectIdDict(1=>1, 2=>2, 3=>3)
Expand Down

2 comments on commit 8ce9f3f

@yuyichao
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you spell Stefan's name incorrectly (so he didn't get pinged)...
Please also don't mention people in the commit message since the notification will be sent out everytime the commit got rebased by anyone.

@StefanKarpinski
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally bad practice but doesn't matter in this case since I get notified about everything on the repo.

Please sign in to comment.