ropensci / bibtex

bibtex parser for R
https://docs.ropensci.org/bibtex/
35 stars 12 forks source link

Improve test suite for bibtex #46

Closed dieghernan closed 2 years ago

dieghernan commented 2 years ago

This PR increases the test suite for bibtex package (Phase 1: Current state / Testing on #45 ). I tried to cover as many cases as I can, including also some additional .bib files for testing purposes:

The tests mainly covers the R source code. It seems to be that a lot of the C code is not currently used (¿?).

Additionally, I upgraded testthat version to 3 (this allows the use of snapshots, that would be useful for testing Phase 2) and improved the R-CMD-Check action to increase the number of platforms on which the package is tested.

Any further improvements on the testing welcomed.

PS: Note that neither R not C code has been modified so far.

dieghernan commented 2 years ago

Ping @matthewwiese

matthewwiese commented 2 years ago

If you're looking for additional testing material, try the Collection of Computer Science Bibliographies whose entries contain their BibTeX source. I discovered it thanks to this Academia StackExchange comment some time back. Also, I think increasing coverage of malformed input is important. Currently there appears to be only two cases (1, 2) of error checking; if the effort will be made to rewrite the package then making sure it fails gracefully is crucial.

Otherwise, glad to see your enthusiasm on this!

dieghernan commented 2 years ago

HI @matthewwiese :

I tried to add more test on errors due to unbalanced braces, etc (see also #42 and tests/testthat/test-fatal-errors.R but unfortunately the package crashes. I left them (skipped) as a reminder for future improvements

UPDATE: Now not skipped in #47

dieghernan commented 2 years ago

Hi @coatless , did you have the chance of having a look on this? Regards

dieghernan commented 2 years ago

Thanks @coatless, I made some minor amendments following your comments. Ready for merge