output-file testing function