diff options
| author | Craig Jennings <c@cjennings.net> | 2024-05-05 09:23:58 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2024-05-05 09:34:19 -0500 |
| commit | 4566ec69d269ecba8d9386a131b932ee5244aa8e (patch) | |
| tree | fa00edae4ba8c93eee7861fa795052511d4e0f29 /tests/test-title-case-region.el | |
| parent | 5f19638abc20eb24511a4129df2be09e1554591c (diff) | |
| download | dotemacs-4566ec69d269ecba8d9386a131b932ee5244aa8e.tar.gz dotemacs-4566ec69d269ecba8d9386a131b932ee5244aa8e.zip | |
enhancements, functions, tests, and misc
enhancements
- move accent-company to C-` and ensure it's on for org mode
- re-enable narrow-to-region
- turn on network repos by default
- remove setq in company's use-package custom clause
- increase company delay to .7 secs
- recipe templates should have visibility show all
- move video recordings code to separate module
- move geiser-guile to prog-lisp
functions
- improve cj/reformat-region-or-buffer via restriction
- improvements to test-format-region
- adding tests for clear-blank-lines
- Add prepend-lines and replace-fraction-glyphs functions
- add cj/clear-blank-lines function
- create cj/load-all-tests utility function
tests
- add keybinding for ert-run-tests-interactively
- ensure ert libraries are available to load-all-tests
- remove running the tests when evaluating the buffer
- fix clear-blank-lines and adding better tests
misc
- updated packages
- adding the luddite blog to elfeed
- more abbrevs
Diffstat (limited to 'tests/test-title-case-region.el')
| -rw-r--r-- | tests/test-title-case-region.el | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/test-title-case-region.el b/tests/test-title-case-region.el new file mode 100644 index 00000000..ffab0c24 --- /dev/null +++ b/tests/test-title-case-region.el @@ -0,0 +1,44 @@ +;;; test-title-case-region.el --- -*- lexical-binding: t; -*- + +;;; Commentary: +;; Tests for the title-case region function in custom-functions.el + +;; Note on Title Case +;; Title case is a capitalization convention where major words are +;; capitalized,and most minor words are lowercase. Nouns,verbs (including +;; linking verbs), adjectives, adverbs,pronouns,and all words of four letters or +;; more are considered major words. Short (i.e., three letters or fewer) +;; conjunctions, short prepositions,and all articles are considered minor +;; words." + +;; positive case (single line, all lowercase, no skip words) +;; positive case (six lines, mixed case, skip words) +;; negative case (single line, all skip-words) +;; negative case (a long empty string) + + +;;; Code: + +(require 'ert) +(add-to-list 'load-path (concat user-emacs-directory "modules")) +(require 'custom-functions) + +(ert-deftest test-cj/fixup-whitespace-positive-first-line-only () + "Test a positive case with two lines. +Both lines have whitespace at the beginning and the end. This tests that when +this function is called on the first line, only that line is affected." + (let ((testdata " Hello, world! \n Foo bar ") + (expected "Hello, world!\n Foo bar ") + (actual)) + (with-temp-buffer + (insert testdata) + (goto-char (point-min)) + (cj/fixup-whitespace-line-or-region) + (setq actual (buffer-string)) + (should (string= actual expected))))) + + + + +(provide 'test-title-case-region) +;;; test-title-case-region.el ends here. |
