RobinHankin / freegroup

The free group in R
https://robinhankin.github.io/freegroup/
0 stars 0 forks source link

`permsymb()` bug #39

Closed RobinHankin closed 1 month ago

RobinHankin commented 1 month ago

There seems to be some problem with permsymb(). From R CMD check:

checking tests ...
  Running ‘testthat.R’
 ERROR
Running the tests in ‘tests/testthat.R’ failed.
Last 13 lines of output:
   1. └─freegroup (local) permsymb_checker(X = rfree(1, 4), p = rperm(9, 8)) at test_aab.R:25:5
   2.   └─testthat::expect_true(...) at test_aab.R:11:5
  ── Failure ('test_aab.R:11:5'): Test suite aab.R ───────────────────────────────
  all(X == X %>% permsymb(as.function(p)) %>% permsymb(as.function(-p))) is not TRUE

  `actual`:   FALSE
  `expected`: TRUE 

Also, processing inst/outer.Rmd gives a whole bunch of errors and warnings.

RobinHankin commented 1 month ago

The problem seems to be related to the library("permutations") call in file test_aab.R. In "R packages (2e)" by Hadley Wickham and Jennifer Bryan, we see:

"It’s generally a bad idea to use library(aaapkg) to attach one of your dependencies somewhere in your tests, because it makes the search path in your tests different from how your package actually works. This is covered in more detail in Section 14.2.5."