JuliaTesting / ReferenceTests.jl

Utility package for comparing data against reference files
https://juliatesting.github.io/ReferenceTests.jl/latest/
Other
82 stars 14 forks source link

[WIP] `@test_reference`: add the `return_bool` keyword argument to get the pass/fail status as a `Bool` #111

Closed DilumAluthge closed 2 years ago

IanButterworth commented 2 years ago

This might be better as a @check_reference macro, or something like that? @test... is kind of tied into the Test architecture?

Not a strong opinion

johnnychen94 commented 2 years ago

This is a good change but might need some refactoring work. We've discussed changing the interface to match_reference(x, ref; kw...)::Bool would be a satisfying solution: that people can use normal Tests utilities to do the common work, e.g.,

@test match_reference(line, "this is the reference line")
@test_broken match_reference(line, "this is another line")
DilumAluthge commented 2 years ago

Sure, I can refactor the code out into a match_reference function, and then test_reference would call match_reference under the hood.

DilumAluthge commented 2 years ago

112