diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-01 17:33:09 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-01 17:33:09 -0500 |
| commit | c2ba1d8f25463bf6342ac635850500a9738b31e9 (patch) | |
| tree | 69518c846bc2e9b11559dc637b6ee81d9d3511c0 /tests/test-pearl-naming.el | |
| parent | 4eab7a048ca18eeef31e4f8d0823182fc6e2368f (diff) | |
| download | pearl-c2ba1d8f25463bf6342ac635850500a9738b31e9.tar.gz pearl-c2ba1d8f25463bf6342ac635850500a9738b31e9.zip | |
refactor: rename saved-query surface to local-view vocabulary
I renamed Pearl's "saved query" surface to the local/Linear view vocabulary, with no obsolete aliases, since Pearl has no users to protect. The defcustom pearl-saved-queries is now pearl-local-views. The commands pearl-run-saved-query, pearl-delete-saved-query, pearl-sync-saved-query-to-linear, pearl-run-view, and pearl-publish-current-source become pearl-run-local-view, pearl-delete-local-view, pearl-publish-local-view, pearl-run-linear-view, and pearl-publish-current-view.
User-facing prompts, messages, and docstrings drop "saved query" for "local view", and the publish command reads "publish" instead of "sync". Internal GraphQL and helper names keep their "query" terms, which a user never sees. A naming-regression test asserts the new symbols exist, the old ones are gone rather than aliased, and no public command exposes "query".
Phase 1 of docs/local-and-linear-views-spec.org. No behavior change. Suite, compile, and lint are green.
Diffstat (limited to 'tests/test-pearl-naming.el')
| -rw-r--r-- | tests/test-pearl-naming.el | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/tests/test-pearl-naming.el b/tests/test-pearl-naming.el new file mode 100644 index 0000000..41077e9 --- /dev/null +++ b/tests/test-pearl-naming.el @@ -0,0 +1,74 @@ +;;; test-pearl-naming.el --- Naming-regression tests for local/Linear views -*- lexical-binding: t; -*- + +;; Copyright (C) 2026 Craig Jennings + +;; Author: Craig Jennings <c@cjennings.net> + +;; This program is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see <http://www.gnu.org/licenses/>. + +;;; Commentary: + +;; The local/Linear views spec renames Pearl's "saved query" surface to +;; local-view vocabulary with NO obsolete aliases (Pearl has no users). +;; These tests enforce the contract: the new public symbols exist, the old +;; ones are gone (not aliased), and no user-facing command exposes "query". + +;;; Code: + +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) + +(defconst test-pearl-naming--new-commands + '(pearl-run-local-view + pearl-delete-local-view + pearl-publish-local-view + pearl-publish-current-view + pearl-run-linear-view) + "Public commands the rename introduces.") + +(defconst test-pearl-naming--old-symbols + '(pearl-saved-queries + pearl-run-saved-query + pearl-delete-saved-query + pearl-sync-saved-query-to-linear + pearl-run-view + pearl-publish-current-source) + "Old user-facing symbols that must be gone (renamed, not aliased).") + +(ert-deftest test-pearl-naming-new-defcustom-bound () + "`pearl-local-views' is the renamed local-view store." + (should (boundp 'pearl-local-views))) + +(ert-deftest test-pearl-naming-new-commands-exist () + "Every renamed public command is defined and interactive." + (dolist (cmd test-pearl-naming--new-commands) + (should (fboundp cmd)) + (should (commandp cmd)))) + +(ert-deftest test-pearl-naming-old-symbols-gone () + "The old saved-query symbols are not bound -- direct rename, no aliases." + (dolist (sym test-pearl-naming--old-symbols) + (should-not (fboundp sym)) + (should-not (boundp sym)))) + +(ert-deftest test-pearl-naming-no-user-facing-query-in-docstrings () + "Public local-view commands and the defcustom carry no \"saved query\" text. +\"query\" alone survives only in internal GraphQL helpers, not here." + (dolist (sym (cons 'pearl-local-views test-pearl-naming--new-commands)) + (let ((doc (or (documentation-property sym 'variable-documentation) + (ignore-errors (documentation sym)) + ""))) + (should-not (string-match-p "saved quer" doc))))) + +(provide 'test-pearl-naming) +;;; test-pearl-naming.el ends here |
