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

`does not prepend ^ if input path begins with * glob`