[WIP/RFC] Add unit tests for buffer.c and fileio.c

Better to explicitly send `0` here than coalesce it in the helper function above.