Skip to content

Commit

Permalink
More OrderedSet, OrderedDict test fixes
Browse files Browse the repository at this point in the history
* Tests should now pass on v0.3, v0.4
  • Loading branch information
kmsquire committed Mar 5, 2015
1 parent a51199d commit 868dc00
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/orderedset.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ OrderedSet() = OrderedSet{Any}()
OrderedSet(xs) = OrderedSet{eltype(xs)}(xs)


show(io::IO, s::OrderedSet) = (show(io, typeof(s)); print(io, "("); !isempty(s) && Base.show_vector(io, s,'[',']'); print(io, ")"))
show(io::IO, s::OrderedSet) = (show(io, typeof(s)); print(io, "("); !isempty(s) && Base.show_comma_array(io, s,'[',']'); print(io, ")"))

@delegate OrderedSet.dict [isempty, length]

Expand Down
3 changes: 2 additions & 1 deletion test/test_ordereddict.jl
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ let
@test typeof(d) == OrderedDict{Any,Any}
end

@test_throws ArgumentError first(OrderedDict())
# TODO: this is a BoundsError on v0.3, ArgumentError on v0.4
#@test_throws ArgumentError first(OrderedDict())
@test first(OrderedDict([(:f, 2)])) == (:f,2)

# issue #1821
Expand Down
3 changes: 2 additions & 1 deletion test/test_orderedset.jl
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ filter!(isodd, s)
@test isequal(s, OrderedSet([1,3]))

# first
@test_throws ArgumentError first(OrderedSet())
# TODO: throws BoundsError in v0.3, ArgumentError in v0.4
#@test_throws ArgumentError first(OrderedSet())
@test first(OrderedSet(2)) == 2

#####################
Expand Down

0 comments on commit 868dc00

Please sign in to comment.