]> git.eshelyaron.com Git - emacs.git/commitdiff
Add multi/unibyte string tests for key-description
authorRobert Pluim <rpluim@gmail.com>
Tue, 14 May 2024 15:41:57 +0000 (17:41 +0200)
committerEshel Yaron <me@eshelyaron.com>
Sat, 18 May 2024 18:51:00 +0000 (20:51 +0200)
* test/src/keymap-tests.el (keymap--key-description): Add multi/unibyte
tests.

This is to check the fix for Bug#59305.

(cherry picked from commit cdf49336cd06c433d2aa7795672aebe413c92f54)

test/src/keymap-tests.el

index 04b897045dbb2f91de73cba83027a9dcf92df2d4..e968a19eadfc586c8613513a6954f7e1584080fb 100644 (file)
@@ -357,6 +357,13 @@ g .. h             foo
                  "C-x <right>"))
   (should (equal (key-description [M-H-right] [?\C-x])
                  "C-x M-H-<right>"))
+  ;; Treat latin-1 correctly vs meta.  (Bug#59305)
+  (should (equal (key-description "olá")
+                 "o l á"))
+  (should (equal (key-description (string ?o ?l ?á))
+                 "o l á"))
+  (should (equal (key-description (unibyte-string ?o ?l ?á))
+                 "o l M-a"))
   (should (equal (single-key-description 'home)
                  "<home>"))
   (should (equal (single-key-description 'home t)