Skip to content

Commit

Permalink
Merge pull request JuliaLang#202 from exercism/accumulate_ex
Browse files Browse the repository at this point in the history
Fixed mistakes in accumulate
  • Loading branch information
logankilpatrick authored Dec 16, 2019
2 parents edc5a37 + 4cede05 commit 396e834
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion exercises/accumulate/accumulate.ipynb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions exercises/accumulate/example.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ a new collection.
"""
function accumulate(collection, operation)

new_collection = []

new_collection = operation.(collection, collection)

return new_collection
end
5 changes: 4 additions & 1 deletion exercises/accumulate/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# canonical data version: 1.1.0

using Test

Expand All @@ -23,3 +22,7 @@
@testset "mod" begin
@test accumulate(collect(1:10), %) == [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
end

@testset "square" begin
@test accumulate(collect(1:10), ^) == [1, 4, 27, 256, 3125, 46656, 823543, 16777216, 387420489, 10000000000]
end

0 comments on commit 396e834

Please sign in to comment.