summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPip Cet <pipcet@gmail.com>2020-08-21 14:47:45 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2020-08-21 14:47:45 +0200
commit19ee08f1e8599ce0e0465f6ffbd4a76791d791b4 (patch)
tree3fa8d56a55b5166e619065aade6b84cf3ced7e04 /test
parenta415179b56f022f50138f55d231070e3d1b00697 (diff)
downloademacs-19ee08f1e8599ce0e0465f6ffbd4a76791d791b4.tar.gz
Fix return value for CCL opcode lookup-integer
* src/ccl.c (ccl_driver): Fix LookupIntConstTbl return value. * test/lisp/international/ccl-tests.el (ccl-hash-table): Add test. * lisp/international/ccl.el (ccl-embed-data): Don't pass non-numbers to `ccl-fixnum' (bug#36740).
Diffstat (limited to 'test')
-rw-r--r--test/lisp/international/ccl-tests.el14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/lisp/international/ccl-tests.el b/test/lisp/international/ccl-tests.el
index 9277d0162e8..16e591f1dd5 100644
--- a/test/lisp/international/ccl-tests.el
+++ b/test/lisp/international/ccl-tests.el
@@ -232,3 +232,17 @@ At EOF:
(with-temp-buffer
(ccl-dump prog-midi-code)
(should (equal (buffer-string) prog-midi-dump))))
+
+(ert-deftest ccl-hash-table ()
+ (let ((sym (gensym))
+ (table (make-hash-table :test 'eq)))
+ (puthash 16 17 table)
+ (puthash 17 16 table)
+ (define-translation-hash-table sym table)
+ (let* ((prog `(2
+ ((loop
+ (lookup-integer ,sym r0 r1)))))
+ (compiled (ccl-compile prog))
+ (registers [17 0 0 0 0 0 0 0]))
+ (ccl-execute compiled registers)
+ (should (equal registers [2 16 0 0 0 0 0 1])))))