Mercurial > hg > xemacs-beta
annotate tests/automated/lisp-reader-tests.el @ 5559:f3ab0c29c246
Use a better, more portable approach to the shift-F11 problem.
src/ChangeLog addition:
2011-08-28 Aidan Kehoe <kehoea@parhasard.net>
* event-Xt.c (x_to_emacs_keysym):
Take a new pointer argument, X_KEYSYM_OUT, where we store the X11
keysym that we actually used.
* event-Xt.c (x_event_to_emacs_event):
Call x_to_emacs_keysym with its new pointer argument, so we have
access to the X11 keysym used.
When checking whether a keysym obeys caps lock, use the X11 keysym
rather than the XEmacs keysym.
When checking whether a key has two distinct keysyms depending on
whether shift is pressed or not, use the X11 keysym passed back by
x_to_emacs_keysym rather than working it out again using
XLookupKeysym().
* event-Xt.c (keysym_obeys_caps_lock_p):
Use XConvertCase() in this function, now we're receiving the
actual X keysym used.
| author | Aidan Kehoe <kehoea@parhasard.net> |
|---|---|
| date | Sun, 28 Aug 2011 10:34:54 +0100 |
| parents | 159face738c3 |
| children | 58b38d5b32d0 |
| rev | line source |
|---|---|
| 3543 | 1 ;; Copyright (C) 2005 Martin Kuehl. |
| 2 | |
| 3 ;; Author: Martin Kuehl <martin.kuehl@gmail.com> | |
| 4 ;; Maintainer: Martin Kuehl <martin.kuehl@gmail.com> | |
| 5 ;; Created: 2005 | |
| 6 ;; Keywords: tests | |
| 7 | |
|
5290
e6508b64ee08
More permission consistency.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
3543
diff
changeset
|
8 ;; This file is part of XEmacs. |
| 3543 | 9 |
|
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
3543
diff
changeset
|
10 ;; XEmacs is free software: you can redistribute it and/or modify it |
|
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
3543
diff
changeset
|
11 ;; under the terms of the GNU General Public License as published by the |
|
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
3543
diff
changeset
|
12 ;; Free Software Foundation, either version 3 of the License, or (at your |
|
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
3543
diff
changeset
|
13 ;; option) any later version. |
| 3543 | 14 |
|
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
3543
diff
changeset
|
15 ;; XEmacs is distributed in the hope that it will be useful, but WITHOUT |
|
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
3543
diff
changeset
|
16 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
3543
diff
changeset
|
17 ;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
3543
diff
changeset
|
18 ;; for more details. |
| 3543 | 19 |
| 20 ;; You should have received a copy of the GNU General Public License | |
|
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
3543
diff
changeset
|
21 ;; along with XEmacs. If not, see <http://www.gnu.org/licenses/>. |
| 3543 | 22 |
| 23 ;;; Synched up with: Not in FSF. | |
| 24 | |
| 25 ;;; Commentary: | |
| 26 | |
| 27 ;; Test the lisp reader. | |
| 28 ;; See test-harness.el for instructions on how to run these tests. | |
| 29 | |
| 30 ;;; Raw Strings | |
| 31 ;;; =========== | |
| 32 | |
| 33 ;; Equality to "traditional" strings | |
| 34 ;; --------------------------------- | |
| 35 (dolist (strings '((#r"xyz" "xyz") ; no backslashes | |
| 36 (#r"\xyz" "\\xyz") ; backslash at start | |
| 37 (#r"\\xyz" "\\\\xyz") ; backslashes at start | |
| 38 (#r"\nxyz" "\\nxyz") ; escape seq. at start | |
| 39 (#r"\"xyz" "\\\"xyz") ; quote at start | |
| 40 (#r"xy\z" "xy\\z") ; backslash in middle | |
| 41 (#r"xy\\z" "xy\\\\z") ; backslashes in middle | |
| 42 (#r"xy\nz" "xy\\nz") ; escape seq. in middle | |
| 43 (#r"xy\"z" "xy\\\"z") ; quote in middle | |
| 44 ;;(#r"xyz\" "xyz\\") ; backslash at end: error | |
| 45 (#r"xyz\\" "xyz\\\\") ; backslashes at end | |
| 46 (#r"xyz\n" "xyz\\n") ; escape seq. at end | |
| 47 (#r"xyz\"" "xyz\\\"") ; quote at end | |
| 48 (#ru"\u00ABxyz" "\u00ABxyz") ; one Unicode escape | |
| 49 (#rU"\U000000ABxyz" "\U000000ABxyz") ; another Unicode escape | |
| 50 (#rU"xyz\u00AB" "xyz\u00AB") ; one Unicode escape | |
| 51 )) | |
| 52 (Assert (apply #'string= strings))) | |
| 53 | |
| 54 ;; Odd number of backslashes at the end | |
| 55 ;; ------------------------------------ | |
| 56 (dolist (string '("#r\"xyz\\\"" ; `#r"abc\"': escaped delimiter | |
| 57 "#r\"xyz\\\\\\\"" ; `#r"abc\\\"': escaped delimiter | |
| 58 )) | |
| 59 (with-temp-buffer | |
| 60 (insert string) | |
| 61 (Check-Error end-of-file (eval-buffer)))) | |
| 62 | |
| 63 ;; Alternate string/regex delimiters | |
| 64 ;; --------------------------------- | |
| 65 (dolist (string '("#r/xyz/" ; Perl syntax | |
| 66 "#r:ix/xyz/" ; Extended Perl syntax | |
| 67 "#r|xyz|" ; TeX syntax | |
| 68 "#r[xyz]" ; (uncommon) Perl syntax | |
| 69 "#r<xyz>" ; Perl6 syntax? | |
| 70 "#r(xyz)" ; arbitrary santax | |
| 71 "#r{xyz}" ; arbitrary santax | |
| 72 "#r,xyz," ; arbitrary santax | |
| 73 "#r!xyz!" ; arbitrary santax | |
| 74 )) | |
| 75 (with-temp-buffer | |
| 76 (insert string) | |
| 77 (Check-Error-Message invalid-read-syntax "unrecognized raw string" | |
| 78 (eval-buffer)))) | |
|
5489
159face738c3
Never pass a leading + to mpz_set_string, parse_integer ().
Aidan Kehoe <kehoea@parhasard.net>
parents:
5420
diff
changeset
|
79 |
|
159face738c3
Never pass a leading + to mpz_set_string, parse_integer ().
Aidan Kehoe <kehoea@parhasard.net>
parents:
5420
diff
changeset
|
80 (when (featurep 'bignum) |
|
159face738c3
Never pass a leading + to mpz_set_string, parse_integer ().
Aidan Kehoe <kehoea@parhasard.net>
parents:
5420
diff
changeset
|
81 ;; This failed, up to 20110501. |
|
159face738c3
Never pass a leading + to mpz_set_string, parse_integer ().
Aidan Kehoe <kehoea@parhasard.net>
parents:
5420
diff
changeset
|
82 (Assert (eql (1+ most-positive-fixnum) |
|
159face738c3
Never pass a leading + to mpz_set_string, parse_integer ().
Aidan Kehoe <kehoea@parhasard.net>
parents:
5420
diff
changeset
|
83 (read (format "+%d" (1+ most-positive-fixnum)))) |
|
159face738c3
Never pass a leading + to mpz_set_string, parse_integer ().
Aidan Kehoe <kehoea@parhasard.net>
parents:
5420
diff
changeset
|
84 "checking leading + is handled properly if reading a bignum") |
|
159face738c3
Never pass a leading + to mpz_set_string, parse_integer ().
Aidan Kehoe <kehoea@parhasard.net>
parents:
5420
diff
changeset
|
85 ;; This never did. |
|
159face738c3
Never pass a leading + to mpz_set_string, parse_integer ().
Aidan Kehoe <kehoea@parhasard.net>
parents:
5420
diff
changeset
|
86 (Assert (eql (1- most-positive-fixnum) |
|
159face738c3
Never pass a leading + to mpz_set_string, parse_integer ().
Aidan Kehoe <kehoea@parhasard.net>
parents:
5420
diff
changeset
|
87 (read (format "+%d" (1- most-positive-fixnum)))) |
|
159face738c3
Never pass a leading + to mpz_set_string, parse_integer ().
Aidan Kehoe <kehoea@parhasard.net>
parents:
5420
diff
changeset
|
88 "checking leading + is handled properly if reading a fixnum")) |
|
159face738c3
Never pass a leading + to mpz_set_string, parse_integer ().
Aidan Kehoe <kehoea@parhasard.net>
parents:
5420
diff
changeset
|
89 |
