2 ms·
Here's a trivial rewrite that satisfies your dogmatic requirement without any meaningful difference: setup() exercise(but_not_for_the_last_time)
by int_19h 4y ago
Here's a trivial rewrite that satisfies your dogmatic requirement without any meaningful difference:
setup()
exercise(but_not_for_the_last_time)
was_blah = (state.currently == blah)
state.do_other()
something(state)
assert was_blah && state.now == blegh
In fact, this last version is worse, because if do_other() can fail if state wasn't blah, then what you'll get is the exception from that failure interrupting the test before the assert would have been reported.
- OJFord 4y agoExactly because that's 'without any meaningful difference' is why I don't like that either. I'm not obsessing over purely the 'assert' keyword as you perhaps think I am, it's the structure I don't like.