From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?q?Sebastian=20Reu=C3=9Fe?= Subject: =?UTF-8?B?W1BBVENIIDYvNl0gSW1wcm92ZSDigJhvcmctc29ydC1saXN04oCZ?= =?UTF-8?B?IHRlc3Q=?= Date: Sun, 11 Mar 2018 16:43:52 +0100 Message-ID: <20180311154352.16920-6-seb@wirrsal.net> References: <20180311154352.16920-1-seb@wirrsal.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51512) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ev39m-0000as-Gi for emacs-orgmode@gnu.org; Sun, 11 Mar 2018 11:45:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ev39j-0008O3-DY for emacs-orgmode@gnu.org; Sun, 11 Mar 2018 11:45:06 -0400 Received: from wirrsal.net ([188.68.36.149]:42800 helo=mail.wirrsal.net) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ev39j-0008Nm-72 for emacs-orgmode@gnu.org; Sun, 11 Mar 2018 11:45:03 -0400 In-Reply-To: <20180311154352.16920-1-seb@wirrsal.net> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org Cc: =?UTF-8?q?Sebastian=20Reu=C3=9Fe?= * test-org-list.el (test-org-list/sort): Take case-sensitive vs. insensitive sorting into account. --- testing/lisp/test-org-list.el | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/testing/lisp/test-org-list.el b/testing/lisp/test-org-list.e= l index 866ee4799..e0c448ce9 100644 --- a/testing/lisp/test-org-list.el +++ b/testing/lisp/test-org-list.el @@ -1015,16 +1015,32 @@ (ert-deftest test-org-list/sort () "Test `org-sort-list'." ;; Sort alphabetically. - (should - (equal "- abc\n- def\n- xyz\n" - (org-test-with-temp-text "- def\n- xyz\n- abc\n" - (org-sort-list nil ?a) - (buffer-string)))) - (should - (equal "- xyz\n- def\n- abc\n" - (org-test-with-temp-text "- def\n- xyz\n- abc\n" - (org-sort-list nil ?A) - (buffer-string)))) + (let ((original-string-collate-lessp (symbol-function 'string-collate-= lessp))) + (cl-letf (((symbol-function 'string-collate-lessp) + (lambda (s1 s2 &optional locale ignore-case) + (funcall original-string-collate-lessp + s1 s2 "C" ignore-case)))) + (should + (equal "- abc\n- def\n- XYZ\n" + (org-test-with-temp-text "- def\n- XYZ\n- abc\n" + (org-sort-list nil ?a) + (buffer-string)))) + (should + (equal "- XYZ\n- def\n- abc\n" + (org-test-with-temp-text "- def\n- XYZ\n- abc\n" + (org-sort-list nil ?A) + (buffer-string)))) + ;; Sort alphabetically (with case). + (should + (equal "- C\n- a\n- b\n" + (org-test-with-temp-text "- b\n- C\n- a\n" + (org-sort-list t ?a) + (buffer-string)))) + (should + (equal "- b\n- a\n- C\n" + (org-test-with-temp-text "- b\n- C\n- a\n" + (org-sort-list t ?A) + (buffer-string)))))) ;; Sort numerically. (should (equal "- 1\n- 2\n- 10\n" --=20 2.16.2