1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
;;; 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
pearl-create-local-view
pearl-edit-local-view
pearl-save-linear-view-locally)
"Public commands the rename and the new phases introduce.")
(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)))))
(ert-deftest test-pearl-naming-no-user-facing-saved-query-phrase ()
"The Pearl-invented \"saved query\" phrase appears nowhere in pearl.el.
Internal helpers may keep the hyphenated `saved-query' symbol fragment, but no
user-facing prompt, message, transient label, or docstring says \"saved query\".
This is the source-level naming regression that locks the rename."
(let ((src (with-temp-buffer
(insert-file-contents (find-library-name "pearl"))
(buffer-string))))
(should-not (string-match-p "saved query" src))))
(provide 'test-pearl-naming)
;;; test-pearl-naming.el ends here
|