Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions man/mdPatternDS.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 41 additions & 0 deletions tests/testthat/test-arg-mdPatternDS.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#-------------------------------------------------------------------------------
# Copyright (c) 2025 ProPASS Consortium. 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("mdPatternDS::arg::setup")

#
# Tests
#

context("mdPatternDS::arg::x NULL")
test_that("mdPatternDS x NULL", {
x <- NULL

expect_error(mdPatternDS(x), "The input object must be of type 'data.frame' or 'matrix'. Current type: NULL")
})

context("mdPatternDS::arg::x not valid variable")
test_that("mdPatternDS x not variable", {
x <- "not a variable"

expect_error(mdPatternDS(x), "Object 'not a variable' does not exist on the server")
})

#
# Done
#

context("mdPatternDS::arg::shutdown")

context("mdPatternDS::arg::done")
37 changes: 37 additions & 0 deletions tests/testthat/test-smk-mdPatternDS.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#-------------------------------------------------------------------------------
# Copyright (c) 2025 ProPASS Consortium. 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("mdPatternDS::smk::setup")

#
# Tests
#

context("mdPatternDS::smk::sample data.frame")
test_that("mdPatternDS: sample data.frame", {
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))
x <- "x_val"

res <- mdPatternDS(x)

expect_length(res, 3)
})

#
# Done
#

context("mdPatternDS::smk::shutdown")

context("mdPatternDS::smk::done")