Skip to content

Commit

Permalink
Add out-of-range base tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kimikage committed Aug 8, 2020
1 parent 9581e88 commit 4a06b10
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/intfuncs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,8 @@ end
@test digits(-3, base = 2) == -[1, 1]
@test digits(-42, base = 4) == -[2, 2, 2]

@test_throws DomainError string(5, base = typemin(Int128) + 10)

@testset "digits/base with bases powers of 2" begin
@test digits(4, base = 2) == [0, 0, 1]
@test digits(5, base = Int32(2), pad=Int32(3)) == [1, 0, 1]
Expand Down

0 comments on commit 4a06b10

Please sign in to comment.