test harness: create append_to_file function