Reformat test code