3 ms·
Unit testing pure functions is a pleasure, no matter if they have local variables. assertEquals(expectedOutput, f(input)); When you split them in a way th
by ajuc 4y ago
Unit testing pure functions is a pleasure, no matter if they have local variables.
assertEquals(expectedOutput, f(input));
When you split them in a way that makes the local state external - you now have to handle the state in unit tests which is much more hassle.