sizespectrum / mizer

Multi-species size-based ecological modelling in R
https://sizespectrum.org/mizer
38 stars 43 forks source link

Better tests for extension mechanism #211

Open gustavdelius opened 3 years ago

gustavdelius commented 3 years ago

We need better tests of the extension mechanism. In particular we need tests for getDiet() and getEncounter() because @baldrech appears to have found a bug in them. Romain's example should form the basis of those tests. getDiet() has a very trivial test of its handling of extensions at https://github.com/sizespectrum/mizer/blob/0139505939fa7ca2091d5a4f45ead5f96372b045/tests/testthat/test-summary_methods.R#L265 . Note how the functions needed in the test need to be set up in an environment.

getEncounter() does not have any tests of its handling of extensions. They should be added to the tests of its basic behaviour at https://github.com/sizespectrum/mizer/blob/0139505939fa7ca2091d5a4f45ead5f96372b045/tests/testthat/test-project_methods.R#L59