From c802ff2a78ba753977f4d191912987d2e9270c54 Mon Sep 17 00:00:00 2001 From: Moritz Schauer Date: Thu, 6 Sep 2018 17:27:49 +0200 Subject: [PATCH] Updates for Julia 1.0 (#33) * Update for Julia 1.0 * Use `Random.seed!` * Also test on 1.0 --- .travis.yml | 3 ++- test/conjugates_normal.jl | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3f7706c..1d7eb5c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,7 @@ os: - osx julia: - 0.7 + - 1.0 - nightly notifications: email: false @@ -12,4 +13,4 @@ notifications: # - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi # - julia --check-bounds=yes -e 'Pkg.clone(pwd()); Pkg.build("ConjugatePriors"); Pkg.test("ConjugatePriors"; coverage=true)' after_success: - - julia -e 'cd(Pkg.dir("ConjugatePriors")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(process_folder())' + - julia -e 'using Pkg; Pkg.add("Coverage"); using Coverage; Coveralls.submit(process_folder())' diff --git a/test/conjugates_normal.jl b/test/conjugates_normal.jl index 7fbe788..1ccb138 100644 --- a/test/conjugates_normal.jl +++ b/test/conjugates_normal.jl @@ -1,7 +1,7 @@ using Distributions using ConjugatePriors -using Random: srand +using Random: seed! using ConjugatePriors: NormalGamma, NormalInverseGamma, NormalInverseChisq using ConjugatePriors: posterior, posterior_rand, posterior_mode, posterior_randmodel, fit_map @@ -164,7 +164,7 @@ w = rand(100) @test mean(pri2) == mean(pri) @test pdf(pri, mu_true, sig2_true) == pdf(pri2, mu_true, sig2_true) - @test (srand(1); rand(pri)) == (srand(1); rand(pri2)) + @test (seed!(1); rand(pri)) == (seed!(1); rand(pri2)) # check that updating is consistent between NIχ2 and NIG post = posterior(pri, Normal, x)