diff options
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 |
