/
test-smk-rUnifDS.R
66 lines (54 loc) · 1.47 KB
/
test-smk-rUnifDS.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#-------------------------------------------------------------------------------
# Copyright (c) 2019-2020 University of Newcastle upon Tyne. All rights reserved.
#
# This program and the accompanying materials
# are made available under the terms of the GNU Public License v3.0.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------
#
# Set up
#
context("rUnifDS::smk::setup")
#
# Tests
#
context("rUnifDS::smk::simple")
test_that("simple rUnifDS, by name", {
n <- 8
min <- 2
max <- 6
res <- rUnifDS(n, "min", "max", 8)
expect_equal(class(res), "numeric")
expect_length(res, 8)
expect_true(res[1] >= 0)
expect_true(res[2] >= 0)
expect_true(res[3] >= 0)
expect_true(res[4] >= 0)
expect_true(res[5] >= 0)
expect_true(res[6] >= 0)
expect_true(res[7] >= 0)
expect_true(res[8] >= 0)
})
test_that("simple rUnifDS, direct", {
n <- 8
min <- 2
max <- 6
res <- rUnifDS(n, min, max, 8)
expect_equal(class(res), "numeric")
expect_length(res, 8)
expect_true(res[1] >= 0)
expect_true(res[2] >= 0)
expect_true(res[3] >= 0)
expect_true(res[4] >= 0)
expect_true(res[5] >= 0)
expect_true(res[6] >= 0)
expect_true(res[7] >= 0)
expect_true(res[8] >= 0)
})
#
# Done
#
context("rUnifDS::smk::shutdown")
context("rUnifDS::smk::done")