R testthat unit test data and helper function conventions

后端 未结 2 1275
孤街浪徒
孤街浪徒 2021-02-12 17:42

I am writing a R package, and I\'m using testthat for unit testing. Many of my unit tests are for testing functions that work on a certain object specific to my package. For the

2条回答
  •  轮回少年
    2021-02-12 18:28

    Maybe it will help you: https://github.com/gmum/gmum.r/tree/master/tests/testthat

    There is helper function called combinations in the file combinations.R Then it is included in test_cec_centroid_assignment.R using source('combinations.R') I'm not sure it is a good convention but it works.

提交回复
热议问题