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

But this could also be dependent on the order of the buffers. Probably need another test for that or re-order the buffers in this test and repeat the assert.