Skip to content

Commit 8bf579f

Browse files
authored
Merge pull request #27 from nicoleepp/ne/fix-1.0
Fix tests on julia 1.0
2 parents 253e075 + 396db15 commit 8bf579f

File tree

5 files changed

+28
-20
lines changed

5 files changed

+28
-20
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ os:
55
- osx
66
julia:
77
- 0.6
8-
- 0.7
8+
- 1.0
99
- nightly
1010
notifications:
1111
email: false

REQUIRE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
julia 0.6
2-
Compat 0.64.0
2+
Compat 1.1.0

appveyor.yml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
environment:
22
matrix:
33
- julia_version: 0.6
4-
- julia_version: 0.7
5-
- julia_version: latest
4+
- julia_version: 1
5+
- julia_version: nightly
66

77
platform:
8-
- x86
9-
- x64
8+
- x86 # 32-bit
9+
- x64 # 64-bit
1010

11-
## uncomment the following lines to allow failures on nightly julia
12-
## (tests will run but not make your overall status red)
13-
#matrix:
14-
# allow_failures:
15-
# - julia_version: latest
11+
# # Uncomment the following lines to allow failures on nightly julia
12+
# # (tests will run but not make your overall status red)
13+
# matrix:
14+
# allow_failures:
15+
# - julia_version: nightly
1616

1717
branches:
1818
only:
@@ -26,12 +26,18 @@ notifications:
2626
on_build_status_changed: false
2727

2828
install:
29-
- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/JuliaCI/Appveyor.jl/master/bin/install.ps1'))
29+
- ps: iex ((new-object net.webclient).DownloadString("https://raw.githubusercontent.com/JuliaCI/Appveyor.jl/version-1/bin/install.ps1"))
3030

3131
build_script:
3232
- echo "%JL_BUILD_SCRIPT%"
33-
- julia -e "%JL_BUILD_SCRIPT%"
33+
- C:\julia\bin\julia -e "%JL_BUILD_SCRIPT%"
3434

3535
test_script:
3636
- echo "%JL_TEST_SCRIPT%"
37-
- julia -e "%JL_TEST_SCRIPT%"
37+
- C:\julia\bin\julia -e "%JL_TEST_SCRIPT%"
38+
39+
# # Uncomment to support code coverage upload. Should only be enabled for packages
40+
# # which would have coverage gaps without running on Windows
41+
# on_success:
42+
# - echo "%JL_CODECOV_SCRIPT%"
43+
# - C:\julia\bin\julia -e "%JL_CODECOV_SCRIPT%"

src/FixedPointDecimals.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@ export FixedDecimal, RoundThrows
2929

3030
using Compat: lastindex, something
3131

32+
import Compat: floatmin, floatmax
33+
3234
import Base: reinterpret, zero, one, abs, sign, ==, <, <=, +, -, /, *, div, rem, divrem,
3335
fld, mod, fldmod, fld1, mod1, fldmod1, isinteger, typemin, typemax,
34-
realmin, realmax, print, show, string, convert, parse, promote_rule, min, max,
36+
print, show, string, convert, parse, promote_rule, min, max,
3537
trunc, round, floor, ceil, eps, float, widemul, decompose
3638

3739
const BitInteger = Union{Int8, UInt8, Int16, UInt16, Int32, UInt32, Int64,
@@ -339,8 +341,8 @@ typemin(::Type{FD{T, f}}) where {T, f} = reinterpret(FD{T, f}, typemin(T))
339341
typemax(::Type{FD{T, f}}) where {T, f}= reinterpret(FD{T, f}, typemax(T))
340342
eps(::Type{T}) where {T <: FD} = reinterpret(T, 1)
341343
eps(x::FD) = eps(typeof(x))
342-
realmin(::Type{T}) where {T <: FD} = eps(T)
343-
realmax(::Type{T}) where {T <: FD} = typemax(T)
344+
floatmin(::Type{T}) where {T <: FD} = eps(T)
345+
floatmax(::Type{T}) where {T <: FD} = typemax(T)
344346

345347
# printing
346348
function print(io::IO, x::FD{T, 0}) where T

test/runtests.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,8 @@ end
288288
@test FD2(42.42) * FD2(1) == FD2(42.42)
289289
end
290290

291-
@testset "eps, realmin, realmax" begin
292-
@test realmin(FD2) == eps(FD2) == FD2(0.01)
291+
@testset "eps, floatmin, floatmax" begin
292+
@test floatmin(FD2) == eps(FD2) == FD2(0.01)
293293
@test eps(FD2(1.11)) == FD2(0.01)
294294
for x in keyvalues[FD2]
295295
if x typemax(FD2)
@@ -298,7 +298,7 @@ end
298298
if x typemin(FD2)
299299
@test x - eps(x) < x
300300
if x 0
301-
@test realmin(FD2) abs(x) realmax(FD2)
301+
@test floatmin(FD2) abs(x) floatmax(FD2)
302302
end
303303
end
304304
end

0 commit comments

Comments
 (0)