Skip to content

Commit

Permalink
Merge pull request #17135 from JuliaLang/ksh/minitests
Browse files Browse the repository at this point in the history
Grab bag of mini tests
  • Loading branch information
kshyatt authored Jun 28, 2016
2 parents 4cce50b + 13d1d2f commit b44ec98
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion base/tuple.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function front(t::Tuple)
@_inline_meta
_front((), t...)
end
front(::Tuple{}) = error("Cannot call front on an empty tuple")
front(::Tuple{}) = throw(ArgumentError("Cannot call front on an empty tuple"))
_front(out, v) = out
function _front(out, v, t...)
@_inline_meta
Expand Down
11 changes: 11 additions & 0 deletions test/bigint.jl
Original file line number Diff line number Diff line change
Expand Up @@ -300,3 +300,14 @@ ndigits(rand(big(-999:999)), big(2)^rand(2:999))
@test_throws InexactError round(BigInt,Inf)
@test_throws InexactError floor(BigInt,Inf)
@test_throws InexactError ceil(BigInt,Inf)

@test bin(big(3)) == "11"
@test oct(big(9)) == "11"
@test oct(-big(9)) == "-11"
@test hex(big(12)) == "c"

@test isqrt(big(4)) == 2
@test isqrt(big(5)) == 2

@test big(5)^true == big(5)
@test big(5)^false == one(BigInt)
7 changes: 7 additions & 0 deletions test/reduce.jl
Original file line number Diff line number Diff line change
Expand Up @@ -287,3 +287,10 @@ A = reshape(map(UInt8, 1:100), (10,10))
@test sum([-0.0]) === -0.0
@test sum([-0.0, -0.0]) === -0.0
@test prod([-0.0, -0.0]) === 0.0

#contains
let A = collect(1:10)
@test A 5
@test A 11
@test contains(==,A,6)
end
3 changes: 3 additions & 0 deletions test/tuple.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
@test length((1,)) === 1
@test length((1,2)) === 2

@test_throws ArgumentError Base.front(())
@test_throws ArgumentError first(())

@test endof(()) === 0
@test endof((1,)) === 1
@test endof((1,2)) === 2
Expand Down

0 comments on commit b44ec98

Please sign in to comment.