Skip to content

Commit

Permalink
Fix bug in pop! and add tests for ClassifiedCollections
Browse files Browse the repository at this point in the history
  • Loading branch information
kshyatt committed Mar 24, 2016
1 parent f1eea87 commit c63c56b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/classifiedcollections.jl
Expand Up @@ -49,4 +49,4 @@ function push!{K, C}(cc::ClassifiedCollections{K, C}, key::K, e)
push!(c, e)
end

pop!{K}(cc::Accumulator{K}, key::K) = pop!(cc.map, key)
pop!{K}(cc::ClassifiedCollections{K}, key::K) = pop!(cc.map, key)
6 changes: 6 additions & 0 deletions test/test_classifiedcollections.jl
Expand Up @@ -20,6 +20,12 @@ push!(c, "high", 5)
@test c["low"] == [1, 2, 3]
@test c["high"] == [4, 5]

@test length(c) == 2
@test collect(keys(c)) == ASCIIString["high","low"]

pop!(c,"low")
@test !haskey(c,"low")

# classified sets

c = classified_sets(ASCIIString, Int)
Expand Down

0 comments on commit c63c56b

Please sign in to comment.