diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-26 13:25:41 -0400 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-26 13:25:41 -0400 |
| commit | ee8fdeb692d666c12ce068a2b1ee90e9451ac892 (patch) | |
| tree | 14e6112715ae68d7b16e1029c4f4f114cdd1efe6 /tests | |
| parent | 06143c61c3782b24c738587ae5e1f427ceb0518c (diff) | |
| download | emacs-wttrin-ee8fdeb692d666c12ce068a2b1ee90e9451ac892.tar.gz emacs-wttrin-ee8fdeb692d666c12ce068a2b1ee90e9451ac892.zip | |
Making a location the default saved it and dropped the favorite name from history, but not the underlying query. For an alias whose query differs from its name, that query lingered as a separate history candidate. Both saving branches now drop the name and the query, matching wttrin-save-location.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test-wttrin-saved-locations.el | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/test-wttrin-saved-locations.el b/tests/test-wttrin-saved-locations.el index 267e5cc..de97df0 100644 --- a/tests/test-wttrin-saved-locations.el +++ b/tests/test-wttrin-saved-locations.el @@ -385,6 +385,23 @@ the directory only and does not also appear as a separate history candidate." (should-not (member "New Orleans" wttrin--location-history)) (should (member "Paris" wttrin--location-history)))) +(ert-deftest test-wttrin-saved-locations-normal-d-alias-drops-query-from-history () + "Normal: making an aliased location the default drops its underlying query from +history, so the place does not also linger as a separate history candidate." + (let ((wttrin-saved-locations nil) + (wttrin-favorite-location nil) + (wttrin-mode-line-mode nil) + (wttrin--location-history '("New Orleans" "Paris"))) + (with-temp-buffer + (setq-local wttrin--current-location "New Orleans") + (setq-local wttrin--current-display "Home") + (cl-letf (((symbol-function 'message) (lambda (&rest _) nil))) + (wttrin-make-default))) + (should (equal "Home" wttrin-favorite-location)) + (should (assoc "Home" (wttrin--saved-locations))) + (should-not (member "New Orleans" wttrin--location-history)) + (should (member "Paris" wttrin--location-history)))) + (ert-deftest test-wttrin-saved-locations-normal-remove-forgets-history () "Normal: removing a saved location drops both its name and its query from history, so a removed place does not resurface as a history candidate." |
