aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-29 04:41:40 -0400
committerCraig Jennings <c@cjennings.net>2026-06-29 04:41:40 -0400
commit37d53dacf0636ae299b092b54dde78c0658a51c1 (patch)
tree6eb61c1a9220bbbf13bafc931476d87b61c5b27d /tests
parent256027866f9ff2cbc3b6155950f21a92b54ea307 (diff)
downloaddotemacs-37d53dacf0636ae299b092b54dde78c0658a51c1.tar.gz
dotemacs-37d53dacf0636ae299b092b54dde78c0658a51c1.zip
refactor: split custom-misc.el into focused modules
custom-misc.el was an incoherent grab-bag, so anything small defaulted to landing there. I split its eight commands by concern. Three moved into new modules: custom-format (region/buffer reformat), custom-counts (word and character counts), and custom-text-transform (fraction glyphs). The other three went to existing homes: the previous-buffer toggle to custom-buffer-file, the delimiter jump to custom-line-paragraph, and the align-regexp space advice with its alignment and fill bindings to custom-whitespace. The C-; bindings, which-key labels, and the six test files moved with their functions, and custom-misc.el is deleted. No behavior change: every command keeps its name and its C-; key.
Diffstat (limited to 'tests')
-rw-r--r--tests/test-custom-counts--count-characters.el (renamed from tests/test-custom-misc-cj--count-characters.el)34
-rw-r--r--tests/test-custom-counts-count-characters-buffer-or-region.el (renamed from tests/test-custom-misc-cj-count-characters-buffer-or-region.el)32
-rw-r--r--tests/test-custom-counts-count-words.el (renamed from tests/test-custom-misc-count-words.el)10
-rw-r--r--tests/test-custom-format-format-region.el (renamed from tests/test-custom-misc-format-region.el)10
-rw-r--r--tests/test-custom-line-paragraph-jump-to-matching-paren.el (renamed from tests/test-custom-misc-jump-to-matching-paren.el)10
-rw-r--r--tests/test-custom-text-transform-replace-fraction-glyphs.el (renamed from tests/test-custom-misc-replace-fraction-glyphs.el)10
-rw-r--r--tests/test-init-module-headers.el4
7 files changed, 56 insertions, 54 deletions
diff --git a/tests/test-custom-misc-cj--count-characters.el b/tests/test-custom-counts--count-characters.el
index 1834b5c4f..8abd759f9 100644
--- a/tests/test-custom-misc-cj--count-characters.el
+++ b/tests/test-custom-counts--count-characters.el
@@ -1,7 +1,7 @@
-;;; test-custom-misc-cj--count-characters.el --- Tests for cj/--count-characters -*- lexical-binding: t; -*-
+;;; test-custom-counts--count-characters.el --- Tests for cj/--count-characters -*- lexical-binding: t; -*-
;;; Commentary:
-;; Tests for the cj/--count-characters internal implementation function from custom-misc.el
+;; Tests for the cj/--count-characters internal implementation function from custom-counts.el
;;
;; This internal function counts characters between START and END positions.
;; It validates that START is not greater than END and returns the character count.
@@ -18,7 +18,7 @@
"Stub keymap for testing.")
;; Now load the actual production module
-(require 'custom-misc)
+(require 'custom-counts)
;;; Setup and Teardown
@@ -34,7 +34,7 @@
;;; Normal Cases
-(ert-deftest test-custom-misc-cj--count-characters-normal-simple-text-returns-count ()
+(ert-deftest test-custom-counts--count-characters-normal-simple-text-returns-count ()
"Should count characters in simple text region."
(test-count-characters-setup)
(unwind-protect
@@ -44,7 +44,7 @@
(should (= result 13))))
(test-count-characters-teardown)))
-(ert-deftest test-custom-misc-cj--count-characters-normal-partial-region-returns-count ()
+(ert-deftest test-custom-counts--count-characters-normal-partial-region-returns-count ()
"Should count characters in partial region."
(test-count-characters-setup)
(unwind-protect
@@ -54,7 +54,7 @@
(should (= result 5))))
(test-count-characters-teardown)))
-(ert-deftest test-custom-misc-cj--count-characters-normal-multiline-returns-count ()
+(ert-deftest test-custom-counts--count-characters-normal-multiline-returns-count ()
"Should count characters including newlines."
(test-count-characters-setup)
(unwind-protect
@@ -67,7 +67,7 @@
;;; Boundary Cases
-(ert-deftest test-custom-misc-cj--count-characters-boundary-empty-region-returns-zero ()
+(ert-deftest test-custom-counts--count-characters-boundary-empty-region-returns-zero ()
"Should return 0 for empty region (start equals end)."
(test-count-characters-setup)
(unwind-protect
@@ -77,7 +77,7 @@
(should (= result 0))))
(test-count-characters-teardown)))
-(ert-deftest test-custom-misc-cj--count-characters-boundary-single-character-returns-one ()
+(ert-deftest test-custom-counts--count-characters-boundary-single-character-returns-one ()
"Should return 1 for single character region."
(test-count-characters-setup)
(unwind-protect
@@ -87,7 +87,7 @@
(should (= result 1))))
(test-count-characters-teardown)))
-(ert-deftest test-custom-misc-cj--count-characters-boundary-large-region-returns-count ()
+(ert-deftest test-custom-counts--count-characters-boundary-large-region-returns-count ()
"Should handle very large region."
(test-count-characters-setup)
(unwind-protect
@@ -98,7 +98,7 @@
(should (= result 100000)))))
(test-count-characters-teardown)))
-(ert-deftest test-custom-misc-cj--count-characters-boundary-unicode-returns-count ()
+(ert-deftest test-custom-counts--count-characters-boundary-unicode-returns-count ()
"Should count unicode characters (emoji, RTL text, combining characters)."
(test-count-characters-setup)
(unwind-protect
@@ -110,7 +110,7 @@
(should (= result (- (point-max) (point-min))))))
(test-count-characters-teardown)))
-(ert-deftest test-custom-misc-cj--count-characters-boundary-whitespace-only-returns-count ()
+(ert-deftest test-custom-counts--count-characters-boundary-whitespace-only-returns-count ()
"Should count whitespace characters."
(test-count-characters-setup)
(unwind-protect
@@ -121,7 +121,7 @@
(should (= result 7))))
(test-count-characters-teardown)))
-(ert-deftest test-custom-misc-cj--count-characters-boundary-newlines-at-boundaries-returns-count ()
+(ert-deftest test-custom-counts--count-characters-boundary-newlines-at-boundaries-returns-count ()
"Should count newlines at start and end."
(test-count-characters-setup)
(unwind-protect
@@ -132,7 +132,7 @@
(should (= result 9))))
(test-count-characters-teardown)))
-(ert-deftest test-custom-misc-cj--count-characters-boundary-binary-content-returns-count ()
+(ert-deftest test-custom-counts--count-characters-boundary-binary-content-returns-count ()
"Should handle binary content."
(test-count-characters-setup)
(unwind-protect
@@ -144,7 +144,7 @@
;;; Error Cases
-(ert-deftest test-custom-misc-cj--count-characters-error-start-greater-than-end-signals-error ()
+(ert-deftest test-custom-counts--count-characters-error-start-greater-than-end-signals-error ()
"Should signal error when start is greater than end."
(test-count-characters-setup)
(unwind-protect
@@ -154,7 +154,7 @@
:type 'error))
(test-count-characters-teardown)))
-(ert-deftest test-custom-misc-cj--count-characters-error-positions-out-of-bounds-handled ()
+(ert-deftest test-custom-counts--count-characters-error-positions-out-of-bounds-handled ()
"Should handle positions beyond buffer bounds (Emacs handles this)."
(test-count-characters-setup)
(unwind-protect
@@ -167,5 +167,5 @@
(should (= result 5))))
(test-count-characters-teardown)))
-(provide 'test-custom-misc-cj--count-characters)
-;;; test-custom-misc-cj--count-characters.el ends here
+(provide 'test-custom-counts--count-characters)
+;;; test-custom-counts--count-characters.el ends here
diff --git a/tests/test-custom-misc-cj-count-characters-buffer-or-region.el b/tests/test-custom-counts-count-characters-buffer-or-region.el
index dbbda00d8..adeb812a8 100644
--- a/tests/test-custom-misc-cj-count-characters-buffer-or-region.el
+++ b/tests/test-custom-counts-count-characters-buffer-or-region.el
@@ -1,7 +1,7 @@
-;;; test-custom-misc-cj-count-characters-buffer-or-region.el --- Tests for cj/count-characters-buffer-or-region -*- lexical-binding: t; -*-
+;;; test-custom-counts-count-characters-buffer-or-region.el --- Tests for cj/count-characters-buffer-or-region -*- lexical-binding: t; -*-
;;; Commentary:
-;; Tests for the cj/count-characters-buffer-or-region function from custom-misc.el
+;; Tests for the cj/count-characters-buffer-or-region function from custom-counts.el
;;
;; This function counts characters in the active region or the entire buffer
;; if no region is active. It displays the count in the minibuffer.
@@ -18,7 +18,7 @@
"Stub keymap for testing.")
;; Now load the actual production module
-(require 'custom-misc)
+(require 'custom-counts)
;;; Setup and Teardown
@@ -35,7 +35,7 @@
;;; Normal Cases
-(ert-deftest test-custom-misc-cj-count-characters-buffer-or-region-normal-whole-buffer-counts-all ()
+(ert-deftest test-custom-counts-count-characters-buffer-or-region-normal-whole-buffer-counts-all ()
"Should count all characters in buffer when no region is active."
(test-count-characters-buffer-or-region-setup)
(unwind-protect
@@ -51,7 +51,7 @@
(should (string-match-p "13 characters.*buffer" message-output)))))
(test-count-characters-buffer-or-region-teardown)))
-(ert-deftest test-custom-misc-cj-count-characters-buffer-or-region-normal-active-region-counts-region ()
+(ert-deftest test-custom-counts-count-characters-buffer-or-region-normal-active-region-counts-region ()
"Should count characters in active region."
(test-count-characters-buffer-or-region-setup)
(unwind-protect
@@ -70,7 +70,7 @@
(should (string-match-p "5 characters.*region" message-output)))))
(test-count-characters-buffer-or-region-teardown)))
-(ert-deftest test-custom-misc-cj-count-characters-buffer-or-region-normal-multiline-buffer-counts-all ()
+(ert-deftest test-custom-counts-count-characters-buffer-or-region-normal-multiline-buffer-counts-all ()
"Should count characters including newlines in buffer."
(test-count-characters-buffer-or-region-setup)
(unwind-protect
@@ -86,7 +86,7 @@
(should (string-match-p "20 characters.*buffer" message-output)))))
(test-count-characters-buffer-or-region-teardown)))
-(ert-deftest test-custom-misc-cj-count-characters-buffer-or-region-normal-multiline-region-counts-region ()
+(ert-deftest test-custom-counts-count-characters-buffer-or-region-normal-multiline-region-counts-region ()
"Should count characters including newlines in region."
(test-count-characters-buffer-or-region-setup)
(unwind-protect
@@ -108,7 +108,7 @@
;;; Boundary Cases
-(ert-deftest test-custom-misc-cj-count-characters-buffer-or-region-boundary-empty-buffer-returns-zero ()
+(ert-deftest test-custom-counts-count-characters-buffer-or-region-boundary-empty-buffer-returns-zero ()
"Should return 0 for empty buffer."
(test-count-characters-buffer-or-region-setup)
(unwind-protect
@@ -122,7 +122,7 @@
(should (string-match-p "0 characters.*buffer" message-output)))))
(test-count-characters-buffer-or-region-teardown)))
-(ert-deftest test-custom-misc-cj-count-characters-buffer-or-region-boundary-empty-region-counts-buffer ()
+(ert-deftest test-custom-counts-count-characters-buffer-or-region-boundary-empty-region-counts-buffer ()
"Should count whole buffer when region is empty (point equals mark).
When mark and point are at the same position, use-region-p returns nil,
so the function correctly falls back to counting the entire buffer."
@@ -144,7 +144,7 @@ so the function correctly falls back to counting the entire buffer."
(should (string-match-p "13 characters.*buffer" message-output)))))
(test-count-characters-buffer-or-region-teardown)))
-(ert-deftest test-custom-misc-cj-count-characters-buffer-or-region-boundary-large-buffer-counts-all ()
+(ert-deftest test-custom-counts-count-characters-buffer-or-region-boundary-large-buffer-counts-all ()
"Should handle very large buffer."
(test-count-characters-buffer-or-region-setup)
(unwind-protect
@@ -160,7 +160,7 @@ so the function correctly falls back to counting the entire buffer."
(should (string-match-p "100000 characters.*buffer" message-output))))))
(test-count-characters-buffer-or-region-teardown)))
-(ert-deftest test-custom-misc-cj-count-characters-buffer-or-region-boundary-unicode-counts-correctly ()
+(ert-deftest test-custom-counts-count-characters-buffer-or-region-boundary-unicode-counts-correctly ()
"Should count unicode characters (emoji, RTL text) correctly."
(test-count-characters-buffer-or-region-setup)
(unwind-protect
@@ -177,7 +177,7 @@ so the function correctly falls back to counting the entire buffer."
message-output)))))
(test-count-characters-buffer-or-region-teardown)))
-(ert-deftest test-custom-misc-cj-count-characters-buffer-or-region-boundary-whitespace-only-counts-whitespace ()
+(ert-deftest test-custom-counts-count-characters-buffer-or-region-boundary-whitespace-only-counts-whitespace ()
"Should count whitespace characters."
(test-count-characters-buffer-or-region-setup)
(unwind-protect
@@ -193,7 +193,7 @@ so the function correctly falls back to counting the entire buffer."
(should (string-match-p "7 characters.*buffer" message-output)))))
(test-count-characters-buffer-or-region-teardown)))
-(ert-deftest test-custom-misc-cj-count-characters-buffer-or-region-boundary-single-character-returns-one ()
+(ert-deftest test-custom-counts-count-characters-buffer-or-region-boundary-single-character-returns-one ()
"Should return 1 for single character buffer."
(test-count-characters-buffer-or-region-setup)
(unwind-protect
@@ -208,7 +208,7 @@ so the function correctly falls back to counting the entire buffer."
(should (string-match-p "1 character.*buffer" message-output)))))
(test-count-characters-buffer-or-region-teardown)))
-(ert-deftest test-custom-misc-cj-count-characters-buffer-or-region-boundary-narrowed-buffer-counts-visible ()
+(ert-deftest test-custom-counts-count-characters-buffer-or-region-boundary-narrowed-buffer-counts-visible ()
"Should count only visible characters in narrowed buffer."
(test-count-characters-buffer-or-region-setup)
(unwind-protect
@@ -227,5 +227,5 @@ so the function correctly falls back to counting the entire buffer."
(should (string-match-p "7 characters.*buffer" message-output)))))
(test-count-characters-buffer-or-region-teardown)))
-(provide 'test-custom-misc-cj-count-characters-buffer-or-region)
-;;; test-custom-misc-cj-count-characters-buffer-or-region.el ends here
+(provide 'test-custom-counts-count-characters-buffer-or-region)
+;;; test-custom-counts-count-characters-buffer-or-region.el ends here
diff --git a/tests/test-custom-misc-count-words.el b/tests/test-custom-counts-count-words.el
index f2bf793f4..642a5a411 100644
--- a/tests/test-custom-misc-count-words.el
+++ b/tests/test-custom-counts-count-words.el
@@ -1,7 +1,7 @@
-;;; test-custom-misc-count-words.el --- Tests for cj/--count-words -*- lexical-binding: t; -*-
+;;; test-custom-counts-count-words.el --- Tests for cj/--count-words -*- lexical-binding: t; -*-
;;; Commentary:
-;; Tests for the cj/--count-words function from custom-misc.el
+;; Tests for the cj/--count-words function from custom-counts.el
;;
;; This function counts words in a region using Emacs's built-in count-words.
;; A word is defined by Emacs's word boundaries, which generally means
@@ -24,7 +24,7 @@
"Stub keymap for testing.")
;; Now load the actual production module
-(require 'custom-misc)
+(require 'custom-counts)
;;; Test Helpers
@@ -144,5 +144,5 @@ words in it."))
(let ((end (match-end 0)))
(should (= 3 (cj/--count-words start end)))))))
-(provide 'test-custom-misc-count-words)
-;;; test-custom-misc-count-words.el ends here
+(provide 'test-custom-counts-count-words)
+;;; test-custom-counts-count-words.el ends here
diff --git a/tests/test-custom-misc-format-region.el b/tests/test-custom-format-format-region.el
index c40a8898e..27f1c6b99 100644
--- a/tests/test-custom-misc-format-region.el
+++ b/tests/test-custom-format-format-region.el
@@ -1,7 +1,7 @@
-;;; test-custom-misc-format-region.el --- Tests for cj/--format-region -*- lexical-binding: t; -*-
+;;; test-custom-format-format-region.el --- Tests for cj/--format-region -*- lexical-binding: t; -*-
;;; Commentary:
-;; Tests for the cj/--format-region function from custom-misc.el
+;; Tests for the cj/--format-region function from custom-format.el
;;
;; This function reformats text by applying three operations:
;; 1. untabify - converts tabs to spaces
@@ -28,7 +28,7 @@
"Stub keymap for testing.")
;; Now load the actual production module
-(require 'custom-misc)
+(require 'custom-format)
;;; Test Helpers
@@ -157,5 +157,5 @@ Returns the buffer string after operation."
;; Should complete without error
(should (string= (buffer-string) "hello world")))))
-(provide 'test-custom-misc-format-region)
-;;; test-custom-misc-format-region.el ends here
+(provide 'test-custom-format-format-region)
+;;; test-custom-format-format-region.el ends here
diff --git a/tests/test-custom-misc-jump-to-matching-paren.el b/tests/test-custom-line-paragraph-jump-to-matching-paren.el
index 973b6dfa9..31853da67 100644
--- a/tests/test-custom-misc-jump-to-matching-paren.el
+++ b/tests/test-custom-line-paragraph-jump-to-matching-paren.el
@@ -1,7 +1,7 @@
-;;; test-custom-misc-jump-to-matching-paren.el --- Tests for cj/jump-to-matching-paren -*- lexical-binding: t; -*-
+;;; test-custom-line-paragraph-jump-to-matching-paren.el --- Tests for cj/jump-to-matching-paren -*- lexical-binding: t; -*-
;;; Commentary:
-;; Tests for the cj/jump-to-matching-paren function from custom-misc.el
+;; Tests for the cj/jump-to-matching-paren function from custom-line-paragraph.el
;;
;; This function jumps to matching delimiters using Emacs's sexp navigation.
;; It works with any delimiter that has matching syntax according to the
@@ -32,7 +32,7 @@
"Stub keymap for testing.")
;; Now load the actual production module
-(require 'custom-misc)
+(require 'custom-line-paragraph)
;;; Test Helpers
@@ -193,5 +193,5 @@ POINT-POSITION is 1-indexed (1 = first character)."
;; The parens in the string should be ignored
(should (= 18 (test-jump-to-matching-paren "(\"hello (world)\")" 1))))
-(provide 'test-custom-misc-jump-to-matching-paren)
-;;; test-custom-misc-jump-to-matching-paren.el ends here
+(provide 'test-custom-line-paragraph-jump-to-matching-paren)
+;;; test-custom-line-paragraph-jump-to-matching-paren.el ends here
diff --git a/tests/test-custom-misc-replace-fraction-glyphs.el b/tests/test-custom-text-transform-replace-fraction-glyphs.el
index 81d1546e1..ed961c63e 100644
--- a/tests/test-custom-misc-replace-fraction-glyphs.el
+++ b/tests/test-custom-text-transform-replace-fraction-glyphs.el
@@ -1,7 +1,7 @@
-;;; test-custom-misc-replace-fraction-glyphs.el --- Tests for cj/--replace-fraction-glyphs -*- lexical-binding: t; -*-
+;;; test-custom-text-transform-replace-fraction-glyphs.el --- Tests for cj/--replace-fraction-glyphs -*- lexical-binding: t; -*-
;;; Commentary:
-;; Tests for the cj/--replace-fraction-glyphs function from custom-misc.el
+;; Tests for the cj/--replace-fraction-glyphs function from custom-text-transform.el
;;
;; This function bidirectionally converts between text fractions (1/4) and
;; Unicode fraction glyphs (ΒΌ). It supports 5 common fractions:
@@ -28,7 +28,7 @@
"Stub keymap for testing.")
;; Now load the actual production module
-(require 'custom-misc)
+(require 'custom-text-transform)
;;; Test Helpers
@@ -181,5 +181,5 @@ Returns the buffer string after operation."
;; Should complete without error
(should (string= (buffer-string) "1/4")))))
-(provide 'test-custom-misc-replace-fraction-glyphs)
-;;; test-custom-misc-replace-fraction-glyphs.el ends here
+(provide 'test-custom-text-transform-replace-fraction-glyphs)
+;;; test-custom-text-transform-replace-fraction-glyphs.el ends here
diff --git a/tests/test-init-module-headers.el b/tests/test-init-module-headers.el
index 22dec1d5f..c01f19368 100644
--- a/tests/test-init-module-headers.el
+++ b/tests/test-init-module-headers.el
@@ -35,7 +35,9 @@
"custom-datetime"
"custom-buffer-file"
"custom-line-paragraph"
- "custom-misc"
+ "custom-counts"
+ "custom-format"
+ "custom-text-transform"
"custom-ordering"
"custom-text-enclose"
"custom-whitespace"