From 65aec47bf3d949f7401d7b00fd1ee1dd3ee26dd0 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 26 Oct 2025 18:14:00 -0500 Subject: test+fix:custom-file-buffer: add tests, fix linter warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add 58 unit tests for buffer/file utility functions: - cj/copy-link-to-buffer-file (12 tests) - cj/copy-path-to-buffer-file-as-kill (12 tests) - cj/copy-whole-buffer (14 tests) - cj/clear-to-bottom-of-buffer (10 tests) - cj/clear-to-top-of-buffer (10 tests) Tests cover normal cases, boundary cases (unicode, empty buffers, narrowing, read-only buffers), and error cases. Production code change: - Fix linter warning: unused variable 'err' → '_' in cj/move-buffer-and-file --- modules/custom-file-buffer.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/custom-file-buffer.el') diff --git a/modules/custom-file-buffer.el b/modules/custom-file-buffer.el index a56edf18..e0224a32 100644 --- a/modules/custom-file-buffer.el +++ b/modules/custom-file-buffer.el @@ -108,7 +108,7 @@ Returns t on success, nil if buffer not visiting a file." When called interactively, prompts for confirmation if target file exists." (interactive (list (read-directory-name "Move buffer and file (to new directory): "))) (let* ((target (expand-file-name (buffer-name) (expand-file-name dir)))) - (condition-case err + (condition-case _ (cj/--move-buffer-and-file dir nil) (file-already-exists (if (yes-or-no-p (format "File %s exists; overwrite? " target)) -- cgit v1.2.3