diff options
| author | Ian S. Pringle <ian@dapringles.com> | 2026-02-02 12:51:06 -0600 |
|---|---|---|
| committer | Ian S. Pringle <ian@dapringles.com> | 2026-02-02 12:51:06 -0600 |
| commit | 5d631eccd79c782af689ad771c7c5e9f9ee0861c (patch) | |
| tree | 442818614dfb75c144552f3e312de9b111ca40a1 /test | |
| parent | 3148471470e21435939adac19116dfee225a9871 (diff) | |
feat: add the 'oldest sort method to sort by creation day, ascending
This adds the `'oldest` keyword to sort by creation day, ascending (oldest
first). This also adds a test for this behavior and the needed documentation.
Diffstat (limited to 'test')
| -rw-r--r-- | test/test-perspective.el | 37 |
1 files changed, 26 insertions, 11 deletions
diff --git a/test/test-perspective.el b/test/test-perspective.el index 5f521de..20fd38c 100644 --- a/test/test-perspective.el +++ b/test/test-perspective.el @@ -2229,17 +2229,32 @@ persp-test-make-sample-environment." (ert-deftest issue-90-persp-last--vs--persp-find-some () (persp-test-with-persp - (let ((persp-sort 'created)) ; this should be respected when killing - (should-persp-equal '("main") "main" nil "main") - (with-named-persp "A" - (should-persp-equal '("A" "main") "A" "main" "main") - (with-named-persp "B" - (should-persp-equal '("B" "A" "main") "B" "A" "A") - (with-named-persp "C" - (should-persp-equal '("C" "B" "A" "main") "C" "B" "B")) ; pop C - (should-persp-equal '("B" "A" "main") "B" nil "B")) ; pop B - (should-persp-equal '("A" "main") "A" nil "A")) ; pop A - (should-persp-equal '("main") "main" nil "main")))) + (let ((persp-sort 'created)) ; this should be respected when killing + (should-persp-equal '("main") "main" nil "main") + (with-named-persp "A" + (should-persp-equal '("A" "main") "A" "main" "main") + (with-named-persp "B" + (should-persp-equal '("B" "A" "main") "B" "A" "A") + (with-named-persp "C" + (should-persp-equal '("C" "B" "A" "main") "C" "B" "B")) ; pop C + (should-persp-equal '("B" "A" "main") "B" nil "B")) ; pop B + (should-persp-equal '("A" "main") "A" nil "A")) ; pop A + (should-persp-equal '("main") "main" nil "main")))) + +(ert-deftest sort-by-oldest () + (persp-test-with-persp + (let ((persp-sort 'oldest)) + ;; persp-order curr last find-some + (should-persp-equal '("main") "main" nil "main") + (with-named-persp "A" + (should-persp-equal '("main" "A") "A" "main" "main") + (with-named-persp "B" + (should-persp-equal '("main" "A" "B") "B" "A" "A") + (with-named-persp "C" + (should-persp-equal '("main" "A" "B" "C") "C" "B" "B")) + (should-persp-equal '("main" "A" "B") "B" nil "main")) + (should-persp-equal '("main" "A") "main" nil "main")) + (should-persp-equal '("main") "main" nil "main")))) (ert-deftest state-save-and-load () (unwind-protect |
