Skip to content

Commit

Permalink
CHG: add unit tests of tpm2
Browse files Browse the repository at this point in the history
  • Loading branch information
egpivo committed Nov 20, 2023
1 parent 4ca8e51 commit 5d5bbb6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/testthat/test-RcppExports.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,15 @@ test_that("spatmcacvall_rcpp returns the correct result", {
# ...

})

test_that("tpm2 function produces correct output", {
# Set up test data (replace this with your actual test data)
z <- matrix(rnorm(100), nrow = 10, ncol = 10)
P <- matrix(rnorm(100), nrow = 10, ncol = 10)
Phi <- matrix(rnorm(100), nrow = 10, ncol = 10)

# Call the tpm2 function
result <- tpm2(z, P, Phi)

expect_equal(dim(result), c(nrow(z), ncol(Phi)))
})

0 comments on commit 5d5bbb6

Please sign in to comment.