Skip to content

Commit

Permalink
Merge pull request JuliaLang#50 from SaschaMann/smann/custom-set-impr…
Browse files Browse the repository at this point in the history
…ovements

custom-set: Additional hint & testsuite clean-up
  • Loading branch information
SaschaMann committed Mar 5, 2017
2 parents 0a21651 + de9be01 commit 4072e8a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions exercises/custom-set/HINTS.md
@@ -1 +1,3 @@
The tests require a constructor that takes an array. The internals of your custom set implementation can use other data structures but you may have to implement an outer constructor that takes exactly one array for the tests to pass.

Certain methods have a unicode operator equivalent. E.g. `intersect(CustomSet([1, 2, 3, 4]), CustomSet([]))` is equivalent to `CustomSet([1, 2, 3, 4]) ∩ CustomSet([])`.
4 changes: 2 additions & 2 deletions exercises/custom-set/runtests.jl
Expand Up @@ -14,7 +14,7 @@ end
@test !(4 in CustomSet([1, 2, 3]))
end

@testset "subset" begin # TODO ⊆, ⊈
@testset "subset" begin
@test issubset(CustomSet([]), CustomSet([]))
@test issubset(CustomSet([]), CustomSet([1]))
@test !issubset(CustomSet([1]), CustomSet([]))
Expand Down Expand Up @@ -90,7 +90,7 @@ end
cs1 == CustomSet([2, 3])
end
end
@testset "not in-place" begin # TODO use operator ∩
@testset "not in-place" begin
@test isempty(intersect(CustomSet([]), CustomSet([])))
@test isempty(intersect(CustomSet([]), CustomSet([3, 2, 5])))
@test isempty(intersect(CustomSet([1, 2, 3, 4]), CustomSet([])))
Expand Down

0 comments on commit 4072e8a

Please sign in to comment.