Skip to content

Commit

Permalink
Merge pull request JuliaLang#15772 from JuliaLang/ksh/grabbag2
Browse files Browse the repository at this point in the history
Another grab bag of small tests
  • Loading branch information
StefanKarpinski committed Apr 5, 2016
2 parents db2c6ab + 715d1f3 commit ef0a898
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions test/math.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
@test e^2.4 == exp(2.4)
@test e^(2//3) == exp(2//3)

@test Float16(3.) < pi
@test pi < Float16(4.)
@test contains(sprint(show,π),"3.14159")

begin
x = [0.0, 1.0, 2.0, 3.0, 4.0]
clamp!(x, 1, 3)
Expand Down
4 changes: 4 additions & 0 deletions test/rounding.jl
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,7 @@ end
@test Base.Rounding.from_fenv(Base.Rounding.to_fenv(RoundUp)) == RoundUp
@test Base.Rounding.from_fenv(Base.Rounding.to_fenv(RoundDown)) == RoundDown
@test_throws ArgumentError Base.Rounding.from_fenv(-99)

badness = 1//0
@test_throws DivideError round(Int64,badness,RoundNearestTiesAway)
@test_throws DivideError round(Int64,badness,RoundNearestTiesUp)
8 changes: 4 additions & 4 deletions test/tuple.jl
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,15 @@ foo(x, y, z) = x + y + z
@test prod((1,2,3)) === 6

@test all(()) === true
@test all((false)) === false
@test all((true)) === true
@test all((false,)) === false
@test all((true,)) === true
@test all((true, true)) === true
@test all((true, false)) === false
@test all((false, false)) === false

@test any(()) === false
@test any((true)) === true
@test any((false)) === false
@test any((true,)) === true
@test any((false,)) === false
@test any((true, true)) === true
@test any((true, false)) === true
@test any((false, false)) === false
Expand Down

0 comments on commit ef0a898

Please sign in to comment.