Y
Hacker News
new
|
ask
|
show
|
jobs
by
YZF
3333 days ago
Exactly. I've seen tests where some code calls:
printf("hello world");
And the test is:
mock_printf(string) { if string != "hello world" then fail; }
Which is basically just duplicating your code as tests.