Made provisions for edge case: files with an empty name

Added regexp to replace a blank fileName with 'test'.
Added unit test for it.