test: save buffer content to file instead of printing it in Emacs tests