- A test file that asserts answer() == 42
- A file with answer() defined to returns 6 * 9
int answer()
{
return 6 * 9;
}
Thus the initial files give you a red traffic-light (indicating a failing test) since 6*9 == 54.In a cyber-dojo the other day one of the developers (hi Ian) rewrote answer() like this:
int answer()
{
return SIX * NINE;
}
which he made pass like this:
#define SIX 1+5
#define NINE 8+1
Excellent!
No comments:
Post a Comment