Closed lunacookies closed 3 years ago
Seems fine by me!
Not sure what's the best API though...
We can either go with a compile-time switch or a runtime env var.
How would the compile-time switch work? The only thing I can think of is a feature flag.
Yeah, a feature flag is what I had in mind.
Hm, as a third alternative, I originally intended to include assert_eq_exact
method, which doesn't do any kind of auto-indent or newline transformation. But that would be slightly different aim as supporting different preferred styles of testing.
Do you have any thoughts about which approach would work better? New method, special env-var (UPDATE_EXPECT=no-indent
), feature flag?
I think my preferred option is a feature flag, since an env var would likely lead to inconsistency from contributors and a new method would require changing existing code. Plus, how would the auto updating detect the usage of the other method?
I would find this helpful because I don’t indent the test string literals, so when I update tests I have to go back and manually dedent them all.