Skip to content

Commit eda4bdc

Browse files
committed
Initial 'mdPatternDS' tests
1 parent 16e22aa commit eda4bdc

3 files changed

Lines changed: 132 additions & 0 deletions

File tree

man/mdPatternDS.Rd

Lines changed: 54 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#-------------------------------------------------------------------------------
2+
# Copyright (c) 2025 ProPASS Consortium. All rights reserved.
3+
#
4+
# This program and the accompanying materials
5+
# are made available under the terms of the GNU Public License v3.0.
6+
#
7+
# You should have received a copy of the GNU General Public License
8+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
9+
#-------------------------------------------------------------------------------
10+
11+
#
12+
# Set up
13+
#
14+
15+
context("mdPatternDS::arg::setup")
16+
17+
#
18+
# Tests
19+
#
20+
21+
context("mdPatternDS::arg::x NULL")
22+
test_that("mdPatternDS x NULL", {
23+
x <- NULL
24+
25+
expect_error(mdPatternDS(x), "The input object must be of type 'data.frame' or 'matrix'. Current type: NULL")
26+
})
27+
28+
context("mdPatternDS::arg::x not valid variable")
29+
test_that("mdPatternDS x not variable", {
30+
x <- "not a variable"
31+
32+
expect_error(mdPatternDS(x), "Object 'not a variable' does not exist on the server")
33+
})
34+
35+
#
36+
# Done
37+
#
38+
39+
context("mdPatternDS::arg::shutdown")
40+
41+
context("mdPatternDS::arg::done")
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#-------------------------------------------------------------------------------
2+
# Copyright (c) 2025 ProPASS Consortium. All rights reserved.
3+
#
4+
# This program and the accompanying materials
5+
# are made available under the terms of the GNU Public License v3.0.
6+
#
7+
# You should have received a copy of the GNU General Public License
8+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
9+
#-------------------------------------------------------------------------------
10+
11+
#
12+
# Set up
13+
#
14+
15+
context("mdPatternDS::smk::setup")
16+
17+
#
18+
# Tests
19+
#
20+
21+
context("mdPatternDS::smk::sample data.frame")
22+
test_that("mdPatternDS: sample data.frame", {
23+
x_val <- data.frame(v1 = c(0.0, 1.0, 2.0, 3.0, 4.0), v2 = c(4.0, 3.0, 2.0, 1.0, 0.0))
24+
x <- "x_val"
25+
26+
res <- mdPatternDS(x)
27+
28+
expect_length(res, 3)
29+
})
30+
31+
#
32+
# Done
33+
#
34+
35+
context("mdPatternDS::smk::shutdown")
36+
37+
context("mdPatternDS::smk::done")

0 commit comments

Comments
 (0)