diff options
| author | Glenn Morris | 2018-05-07 07:50:49 -0700 |
|---|---|---|
| committer | Glenn Morris | 2018-05-07 07:50:49 -0700 |
| commit | 766b057e41df7316808ec7658836fda75facda75 (patch) | |
| tree | 9f35f8fdc99192a66c01c10b8a6b3cae1fb6ebd4 /test | |
| parent | 6e362a32bc9d21f73a0f29ca6f45481edeea6f29 (diff) | |
| parent | 1d732d699d63b5dbfa7d0a0f44e6119d58f852bc (diff) | |
| download | emacs-766b057e41df7316808ec7658836fda75facda75.tar.gz emacs-766b057e41df7316808ec7658836fda75facda75.zip | |
Merge from origin/emacs-26
1d732d6 (origin/emacs-26) Fix gud-statement for pdb
91a68b5 ; * msdos/INSTALL: Add info about GCC versions.
7ddcc9a Document 'custom-group'
58f9e15 A minor addition to etc/DEBUG
4590414 Avoid errors in ispell.el when Enchant returns empty extra chars
d0d75f9 Make 'ispell-initialize-spellchecker-hook' work again
b90ce66 Handle selected_window change in prepare_menu_bars (Bug#31312)
79ad0b3 ; * INSTALL: Fix Emacs version number. (Bug#31358)
91de88b Fix report-emacs-bug via mailclient on MS-Windows
f4b5ff2 Port collation tests to glibc 2.27
Diffstat (limited to 'test')
| -rw-r--r-- | test/src/fns-tests.el | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/test/src/fns-tests.el b/test/src/fns-tests.el index 0301ceaad52..d9cca557cf2 100644 --- a/test/src/fns-tests.el +++ b/test/src/fns-tests.el | |||
| @@ -119,10 +119,9 @@ | |||
| 119 | 119 | ||
| 120 | ;; In POSIX or C locales, collation order is lexicographic. | 120 | ;; In POSIX or C locales, collation order is lexicographic. |
| 121 | (should (string-collate-lessp "XYZZY" "xyzzy" "POSIX")) | 121 | (should (string-collate-lessp "XYZZY" "xyzzy" "POSIX")) |
| 122 | ;; In a language specific locale, collation order is different. | 122 | ;; In a language specific locale on MS-Windows, collation order is different. |
| 123 | (should (string-collate-lessp | 123 | (when (eq system-type 'windows-nt) |
| 124 | "xyzzy" "XYZZY" | 124 | (should (string-collate-lessp "xyzzy" "XYZZY" "enu_USA"))) |
| 125 | (if (eq system-type 'windows-nt) "enu_USA" "en_US.UTF-8"))) | ||
| 126 | 125 | ||
| 127 | ;; Ignore case. | 126 | ;; Ignore case. |
| 128 | (should (string-collate-equalp "xyzzy" "XYZZY" nil t)) | 127 | (should (string-collate-equalp "xyzzy" "XYZZY" nil t)) |
| @@ -154,8 +153,6 @@ | |||
| 154 | (9 . "aaa") (9 . "zzz") (9 . "ppp") (9 . "fff")]))) | 153 | (9 . "aaa") (9 . "zzz") (9 . "ppp") (9 . "fff")]))) |
| 155 | 154 | ||
| 156 | (ert-deftest fns-tests-collate-sort () | 155 | (ert-deftest fns-tests-collate-sort () |
| 157 | ;; See https://lists.gnu.org/r/emacs-devel/2015-10/msg02505.html. | ||
| 158 | :expected-result (if (eq system-type 'cygwin) :failed :passed) | ||
| 159 | (skip-unless (fns-tests--collate-enabled-p)) | 156 | (skip-unless (fns-tests--collate-enabled-p)) |
| 160 | 157 | ||
| 161 | ;; Punctuation and whitespace characters are relevant for POSIX. | 158 | ;; Punctuation and whitespace characters are relevant for POSIX. |
| @@ -165,15 +162,16 @@ | |||
| 165 | (lambda (a b) (string-collate-lessp a b "POSIX"))) | 162 | (lambda (a b) (string-collate-lessp a b "POSIX"))) |
| 166 | '("1 1" "1 2" "1.1" "1.2" "11" "12"))) | 163 | '("1 1" "1 2" "1.1" "1.2" "11" "12"))) |
| 167 | ;; Punctuation and whitespace characters are not taken into account | 164 | ;; Punctuation and whitespace characters are not taken into account |
| 168 | ;; for collation in other locales. | 165 | ;; for collation in other locales, on MS-Windows systems. |
| 169 | (should | 166 | (when (eq system-type 'windows-nt) |
| 170 | (equal | 167 | (should |
| 171 | (sort '("11" "12" "1 1" "1 2" "1.1" "1.2") | 168 | (equal |
| 172 | (lambda (a b) | 169 | (sort '("11" "12" "1 1" "1 2" "1.1" "1.2") |
| 173 | (let ((w32-collate-ignore-punctuation t)) | 170 | (lambda (a b) |
| 174 | (string-collate-lessp | 171 | (let ((w32-collate-ignore-punctuation t)) |
| 175 | a b (if (eq system-type 'windows-nt) "enu_USA" "en_US.UTF-8"))))) | 172 | (string-collate-lessp |
| 176 | '("11" "1 1" "1.1" "12" "1 2" "1.2"))) | 173 | a b "enu_USA")))) |
| 174 | '("11" "1 1" "1.1" "12" "1 2" "1.2")))) | ||
| 177 | 175 | ||
| 178 | ;; Diacritics are different letters for POSIX, they sort lexicographical. | 176 | ;; Diacritics are different letters for POSIX, they sort lexicographical. |
| 179 | (should | 177 | (should |
| @@ -181,15 +179,17 @@ | |||
| 181 | (sort '("Ævar" "Agustín" "Adrian" "Eli") | 179 | (sort '("Ævar" "Agustín" "Adrian" "Eli") |
| 182 | (lambda (a b) (string-collate-lessp a b "POSIX"))) | 180 | (lambda (a b) (string-collate-lessp a b "POSIX"))) |
| 183 | '("Adrian" "Agustín" "Eli" "Ævar"))) | 181 | '("Adrian" "Agustín" "Eli" "Ævar"))) |
| 184 | ;; Diacritics are sorted between similar letters for other locales. | 182 | ;; Diacritics are sorted between similar letters for other locales, |
| 185 | (should | 183 | ;; on MS-Windows systems. |
| 186 | (equal | 184 | (when (eq system-type 'windows-nt) |
| 187 | (sort '("Ævar" "Agustín" "Adrian" "Eli") | 185 | (should |
| 188 | (lambda (a b) | 186 | (equal |
| 189 | (let ((w32-collate-ignore-punctuation t)) | 187 | (sort '("Ævar" "Agustín" "Adrian" "Eli") |
| 190 | (string-collate-lessp | 188 | (lambda (a b) |
| 191 | a b (if (eq system-type 'windows-nt) "enu_USA" "en_US.UTF-8"))))) | 189 | (let ((w32-collate-ignore-punctuation t)) |
| 192 | '("Adrian" "Ævar" "Agustín" "Eli")))) | 190 | (string-collate-lessp |
| 191 | a b "enu_USA")))) | ||
| 192 | '("Adrian" "Ævar" "Agustín" "Eli"))))) | ||
| 193 | 193 | ||
| 194 | (ert-deftest fns-tests-string-version-lessp () | 194 | (ert-deftest fns-tests-string-version-lessp () |
| 195 | (should (string-version-lessp "foo2.png" "foo12.png")) | 195 | (should (string-version-lessp "foo2.png" "foo12.png")) |