Change unittest from writing output to concatening to an array and checking content

Sorry for the delay, I've been without a computer for most of the week.