Closed shadmansaleh closed 1 year ago
Why not printing debug statements on stderr
?
Why not printing debug statements on stderr?
On tests that contain multiple cases. It's easier to understand which debug output is from which case.
You should have just told me output_compare_method
can be a function.
custom function: you can use a function accepting two arguments, two strings representing output and expected output. It should return true if the given output is acceptable, false otherwise. Example:
require('competitest').setup { output_compare_method = function(output, expected_output) if output == expected_output then return true else return false end end }
Are you interested in exposing a filter function in config that is applied on output before comparing it to check if it's matches with the desired one or not?
I have a debugging function that always prints lines starting with "DBG )>". If competitest compares the output with these removed I can observe the debug output while also check if the test is passing.
I can currently achieve it by injecting a custom compare method like this.
But it's kind of hacky. So I think it'd be nice If competitest allows me to provide a filter function is config.