Skip to content

Conversation

@ReubenJ
Copy link
Contributor

@ReubenJ ReubenJ commented Nov 23, 2025

As mentioned in #179, it would be a cleaner testing experience to compare the entire output of format to a reference output. ReferenceTests.jl implements this workflow.

I've switched all of the tests that were using some pattern of occursin to check that some parts are present in the output to use the reference testing setup.

A couple of nice things with this change:

  1. The entire output of format is tested, not just some substring.
  2. When implementing a new type of abbreviation or fixing an existing case, it's nicer to be able to set up a reference text file with the output you're expecting and develop while testing against it.
  • Run tests in versions of Julia other than 1.11 to generate the reference files for those cases
    • <1.3
  • Update regex replace filter to handle windows case

@ReubenJ ReubenJ force-pushed the test/reference-tests branch 2 times, most recently from d9c9f7e to 850c5a2 Compare November 25, 2025 13:54
@ReubenJ ReubenJ force-pushed the test/reference-tests branch 2 times, most recently from 5f63984 to f58534a Compare November 25, 2025 14:09
Some tests only run for older Julia versions,
these reference files are thus only generated
for the first time when run with an older julia
version.

Run with julia@

- v1.11.6
- v1.6.7
- v1.3.1
- v1.12.2
- v1.1.1

Did not run on Windows, but "simulated" by replacing
'/'s in the reference file with Windows' path separator: '\\'
@ReubenJ ReubenJ force-pushed the test/reference-tests branch from f58534a to cea5f6a Compare November 25, 2025 14:12
@ReubenJ ReubenJ marked this pull request as ready for review November 25, 2025 14:13
@ReubenJ
Copy link
Contributor Author

ReubenJ commented Nov 25, 2025

Updated with #179 (and updated those tests to use references). Should be ready for a 👀 @MichaelHatherly

@MichaelHatherly
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants