Skip to content

Commit dd64616

Browse files
committed
More unit tests
1 parent 4098ddb commit dd64616

3 files changed

Lines changed: 16 additions & 0 deletions

File tree

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,17 @@ README_files/
1010
RcppTskit/**/.quarto/
1111
RcppTskit/cran-comments.html
1212
RcppTskit/cran-comments_files/
13+
RcppTskit/covr/
1314
RcppTskit/inst/doc
15+
RcppTskit/src/*.gcda
16+
RcppTskit/src/*.gcno
1417
RcppTskit/src/*.dll*
1518
RcppTskit/src/*.o
1619
RcppTskit/src/*.so
1720
RcppTskit/src/Makevars
1821
RcppTskit/src/Makevars.win
22+
RcppTskit/src/**/*.gcda
23+
RcppTskit/src/**/*.gcno
1924
RcppTskit/src/tskit/*.o
2025
RcppTskit/vignettes/*.R
2126
RcppTskit/vignettes/*.html

RcppTskit/.Rbuildignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,15 @@
1313
^cran-comments\.html$
1414
^cran-comments\.md$
1515
^cran-comments_files$
16+
^covr$
1617
^inst/examples/create_test\.trees\.R$
1718
^inst/examples/create_test\.trees\.py$
1819
^inst/examples/explore_reticulate\.R$
1920
^inst/examples/explore_slendr\.R$
2021
^notes_pkg_dev\.Rmd$
2122
^pkg_dev_notes\.md$
23+
^src/.*\.gcda$
24+
^src/.*\.gcno$
2225
^test\.trees$
2326
^tests/testthat/_snaps$
2427
^tools/clang-tidy\.py$

RcppTskit/tests/testthat/test_TableCollection.R

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,14 @@ test_that("node_table_add_row wrapper expands the table collection and handles i
509509
m_before_raw + 3L
510510
)
511511

512+
expect_error(
513+
tc$node_table_add_row(flags = -1L),
514+
regexp = "flags must be a non-NA zero or positive integer scalar!"
515+
)
516+
expect_error(
517+
tc$node_table_add_row(time = NA_real_),
518+
regexp = "time must be a non-NA numeric scalar!"
519+
)
512520
expect_error(
513521
tc$node_table_add_row(population = NA_integer_),
514522
regexp = "population must be -1L, NULL, or a non-NA integer scalar!"

0 commit comments

Comments
 (0)