Skip to content

Commit

Permalink
Add split to benchmark tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottPJones committed Apr 17, 2018
1 parent 5cd2e87 commit bca5f8b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/bench.jl
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,14 @@ function oldlength(s::UTF16Str)
cnt
end

function checksplit(lines)
cnt = 0
for text in lines
cnt += length(split(text, " "))
end
cnt
end

repeat1(str) = repeat(str, 1)
repeat10(str) = repeat(str, 10)
repeat1c(str) = @inbounds repeat(str[1], 1)
Expand Down Expand Up @@ -768,6 +776,7 @@ const tests =
(calchash, "hash\nstring"),
(checknextind, "nextind\nchars"),
(checkjoin, "join\nlines"),
(checksplit, "split\nline"),
(checkreverse, "reverse"),
(checkrepeat1, "repeat 1\nstring"),
(checkrepeat10, "repeat 10\nstring"),
Expand Down

0 comments on commit bca5f8b

Please sign in to comment.