Skip to content

Commit 6658707

Browse files
musmdextorious
authored andcommitted
0.6 compatibility
* Remove 0.6 dep warn for abstract type * Add Compat * Add compat to file * Add nightly to appveyor * Update .travis.yml * Update runtests.jl
1 parent 352b58e commit 6658707

File tree

5 files changed

+13
-6
lines changed

5 files changed

+13
-6
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ os:
55
- osx
66
julia:
77
- release
8+
- nightly
89
notifications:
910
email: false
1011
# uncomment the following lines to override the default test script

REQUIRE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
julia 0.5
2+
Compat 0.17.0

appveyor.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ environment:
22
matrix:
33
- JULIAVERSION: "julialang/bin/winnt/x86/0.5/julia-0.5-latest-win32.exe"
44
- JULIAVERSION: "julialang/bin/winnt/x64/0.5/julia-0.5-latest-win64.exe"
5+
- JULIAVERSION: "julianightlies/bin/winnt/x86/julia-latest-win32.exe"
6+
- JULIAVERSION: "julianightlies/bin/winnt/x64/julia-latest-win64.exe"
57

68
branches:
79
only:

src/NumericalIntegration.jl

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@ __precompile__()
22

33
module NumericalIntegration
44

5-
abstract IntegrationMethod
5+
using Compat
6+
7+
export integrate
8+
export Trapezoidal, TrapezoidalEven, TrapezoidalFast, TrapezoidalEvenFast
9+
export SimpsonEven, SimpsonEvenFast
10+
11+
@compat abstract type IntegrationMethod end
12+
613
immutable Trapezoidal <: IntegrationMethod end
714
immutable TrapezoidalEven <: IntegrationMethod end
815
immutable TrapezoidalFast <: IntegrationMethod end
@@ -62,8 +69,4 @@ function integrate{T<:AbstractFloat}(x::Vector{T}, y::Vector{T}, ::SimpsonEvenFa
6269
@inbounds return (x[end] - x[1]) / (length(y) - 1) * retval
6370
end
6471

65-
export integrate
66-
export Trapezoidal, TrapezoidalEven, TrapezoidalFast, TrapezoidalEvenFast
67-
export SimpsonEven, SimpsonEvenFast
68-
6972
end

test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ using Base.Test
33

44
methods = [Trapezoidal(), TrapezoidalEven(), TrapezoidalFast(), TrapezoidalEvenFast(), SimpsonEven(), SimpsonEvenFast()]
55
x = collect(-π : π/1000 : π)
6-
y = sin(x)
6+
y = sin.(x)
77
for method in methods
88
println(string("Testing method: ", typeof(method)))
99
@test abs(integrate(x, y, method)) < 1e-4

0 commit comments

Comments
 (0)