From 35131cb72c08c657d2a3389338d0c049d57e69bd Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Tue, 5 May 2026 05:20:44 -0500 Subject: refactor: rename debug-wttrin-* commands to wttrin-debug-* with obsolete aliases The four interactive commands in `wttrin-debug.el` used `debug-wttrin-` as their prefix instead of the package's `wttrin-debug-` prefix. package-lint flags this as a convention violation, and it makes M-x discovery slightly less consistent for users. Renamed: - `debug-wttrin-show-raw` -> `wttrin-debug-show-raw` - `debug-wttrin-enable` -> `wttrin-debug-enable` - `debug-wttrin-disable` -> `wttrin-debug-disable` - `debug-wttrin-mode-line` -> `wttrin-debug-mode-line` The old names stay available as `define-obsolete-function-alias` entries marked since 0.4.0, so anyone with a keybinding or `(call-interactively 'debug-wttrin-enable)` in their config keeps working. The byte-compiler will emit an obsolescence warning to nudge migration. Aliases will be removed in a future release. Internal caller `wttrin--debug-mode-line-info` now invokes the new name. Test files renamed to match (`test-debug-wttrin-*.el` -> `test-wttrin-debug-*.el`); inside each, ert-deftest names and function calls were updated. Added `tests/test-wttrin-debug-aliases.el` to verify each old name resolves via `indirect-function` to the new name and carries `byte-obsolete-info` with the expected target and "0.4.0" version. --- tests/test-wttrin-debug-enable.el | 43 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 tests/test-wttrin-debug-enable.el (limited to 'tests/test-wttrin-debug-enable.el') diff --git a/tests/test-wttrin-debug-enable.el b/tests/test-wttrin-debug-enable.el new file mode 100644 index 0000000..b5d1217 --- /dev/null +++ b/tests/test-wttrin-debug-enable.el @@ -0,0 +1,43 @@ +;;; test-wttrin-debug-enable.el --- Tests for wttrin-debug-enable -*- lexical-binding: t; -*- + +;; Copyright (C) 2025-2026 Craig Jennings + +;;; Commentary: + +;; Unit tests for wttrin-debug-enable. Verifies the interactive command +;; flips `wttrin-debug' to t and is idempotent when already enabled. + +;;; Code: + +(require 'ert) +(require 'wttrin) +(require 'testutil-wttrin) + +(require 'wttrin-debug + (expand-file-name "wttrin-debug.el" + (file-name-directory (locate-library "wttrin")))) + +;;; Normal Cases + +(ert-deftest test-wttrin-debug-enable-normal-flips-from-nil-to-t () + "Calling enable when wttrin-debug is nil sets it to t." + (let ((wttrin-debug nil)) + (wttrin-debug-enable) + (should (eq wttrin-debug t)))) + +(ert-deftest test-wttrin-debug-enable-normal-idempotent-when-already-enabled () + "Calling enable when wttrin-debug is already t leaves it t." + (let ((wttrin-debug t)) + (wttrin-debug-enable) + (should (eq wttrin-debug t)))) + +;;; Boundary Cases + +(ert-deftest test-wttrin-debug-enable-boundary-overrides-non-boolean-truthy-value () + "Calling enable replaces a non-boolean truthy value with t." + (let ((wttrin-debug 'verbose)) + (wttrin-debug-enable) + (should (eq wttrin-debug t)))) + +(provide 'test-wttrin-debug-enable) +;;; test-wttrin-debug-enable.el ends here -- cgit v1.2.3