Skip to content

Commit

Permalink
Test if we can iterate the full range of the largest bits integer type
Browse files Browse the repository at this point in the history
  • Loading branch information
haampie committed May 18, 2018
1 parent 91fb107 commit 3369089
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/ranges.jl
Original file line number Diff line number Diff line change
Expand Up @@ -418,13 +418,20 @@ end
end
@test s == 2

# loops covering the full range of smaller integer types
# loops covering the full range of integers
s = 0
for i = typemin(UInt8):typemax(UInt8)
s += 1
end
@test s == 256

s = 0
for i = typemin(UInt):typemax(UInt)
i == 10 && break
s += 1
end
@test s == 10

s = 0
for i = typemin(UInt8):one(UInt8):typemax(UInt8)
s += 1
Expand Down

0 comments on commit 3369089

Please sign in to comment.