From 5c2c9a50da3a3f534842ffe95a49fe990000a072 Mon Sep 17 00:00:00 2001 From: Simeon Simeonov Date: Tue, 6 Jan 2026 21:25:57 +0100 Subject: Update markdown, rust and yasnippet --- .emacs.d/lisp/rust-cargo-tests.el | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to '.emacs.d/lisp/rust-cargo-tests.el') diff --git a/.emacs.d/lisp/rust-cargo-tests.el b/.emacs.d/lisp/rust-cargo-tests.el index fe78ac7..1b072ee 100644 --- a/.emacs.d/lisp/rust-cargo-tests.el +++ b/.emacs.d/lisp/rust-cargo-tests.el @@ -21,6 +21,13 @@ (find-file main-file) ,expr))) +(defmacro rust-test--with-snippet-buffer (expr) + `(let* ((test-dir (expand-file-name "test-project/" default-directory)) + (snippet-file (expand-file-name "src/rustfmt-default.rs" test-dir))) + (save-current-buffer + (find-file snippet-file) + ,expr))) + (defun rust-test--find-string (string) "Find STRING in current buffer." (goto-char (point-min)) @@ -70,3 +77,13 @@ (should (eq major-mode 'rust-format-mode)) (should (rust-test--find-string "error:"))) (kill-buffer "*rustfmt*"))) + +(ert-deftest rust-test-respect-rustfmt-defaults () + (skip-unless (executable-find "rustfmt")) + (rust-test--with-snippet-buffer + (let ((old-content (buffer-string)) + (ret (rust-format-buffer))) + (should (string= old-content (buffer-string)))))) + +(ert-deftest rust-test-ensure-rustfmt-switches-nil () + (should (eq rust-rustfmt-switches nil))) -- cgit v1.3