Skip to content

Commit

Permalink
fix tests for change in default RNG on nightly (#699)
Browse files Browse the repository at this point in the history
* fix tests for change in default RNG on nightly

* ditch redundant test
  • Loading branch information
palday authored Jul 14, 2021
1 parent 2faa6e8 commit 8f61785
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 4 additions & 3 deletions test/sampling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,12 @@ wv = Weights([zeros(5); 1:4; -1])
@test_throws ErrorException sample(a, wv, 1, replace=false)

#### weighted sampling with dimension
Random.seed!(1);

@test sample([1, 2], Weights([1, 1]), (2,2)) == ones(2,2)
# weights respected; this works because of the 0-weight
@test sample([1, 2], Weights([0, 1]), (2,2)) == [2 2 ; 2 2]
@test sample(collect(1:4), Weights(1:4), (2,2), replace=false) == [4 1; 3 2]
wm = sample(collect(1:4), Weights(1:4), (2,2), replace=false)
@test size(wm) == (2, 2) # correct shape
@test length(Set(wm)) == 4 # no duplicates in elements


#### check that sample and sample! do the same thing
Expand Down
6 changes: 4 additions & 2 deletions test/statmodels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@ x3 1.56734e-13 Bad 2 0.00 <1e-15
(Name = "x3", Estimate = 1.56734e-13, Comments = "Bad", df = 2, t = 2.68e-16, p = 1.345e-16)
]

Random.seed!(10)
m = rand(3,4)

m = [0.11258244478647295 0.05664544616214151 0.38181274408522614 0.8197779704008801
0.36831406658084287 0.12078054506961555 0.8151038332483567 0.6699313951612162
0.3444540231363058 0.17957407667101322 0.2422083248151139 0.4530583319523316]
ct = CoefTable(m, ["Estimate", "Stderror", "df", "p"], [], 4)
@test sprint(show, ct) == """
──────────────────────────────────────────
Expand Down

0 comments on commit 8f61785

Please sign in to comment.