annotate tests/automated/ccl-tests.el @ 5916:1152e0091f8c

Avoid confusion about ELC vs. source file encoding, #'load, #'load-internal. lisp/ChangeLog addition: 2015-06-03 Aidan Kehoe <kehoea@parhasard.net> * code-files.el (load): Revise this to respect load-ignore-out-of-date-elc-files, rather than leaving that to #'load-internal. Avoids a corner case where the source and the compiled file have different, incompatible encodings. Move the call to #'substitute-in-file-name here. No longer check for a zero-length filename, since #'load-internal no longer chokes on same and errors correctly. src/ChangeLog addition: 2015-06-03 Aidan Kehoe <kehoea@parhasard.net> * lread.c (Fload_internal): Delegate calling the handler and #'substitute-in-file-name to #'load. Error correctly with a zero-length file name, instead of giving a bus error on my machine. Delegate the check for out-of-date ELC files to #'load, avoiding a bug where the encoding of the ELC file and the source file differed. * lread.c (PRINT_LOADING_MESSAGE_1): This is simplified, now we no longer have to talk about out-of-date ELC files. tests/ChangeLog addition: 2015-06-03 Aidan Kehoe <kehoea@parhasard.net> * automated/file-tests.el: Gross sanity check for #'load and #'load-internal with a zero-length FILE, something that crashed until today.
author Aidan Kehoe <kehoea@parhasard.net>
date Wed, 03 Jun 2015 20:13:07 +0100
parents 308d34e9f07d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
1 ;;; ccl-tests.el --- Testsuites on CCL ; -*- coding: iso-2022-7bit -*-
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
2
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
3 ;; Copyright (C) 2000 MIYASHITA Hisashi
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
4
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
5 ;; This file is part of XEmacs.
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
6
5402
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 5136
diff changeset
7 ;; 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: 5136
diff changeset
8 ;; 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: 5136
diff changeset
9 ;; 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: 5136
diff changeset
10 ;; option) any later version.
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
11
5402
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 5136
diff changeset
12 ;; 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: 5136
diff changeset
13 ;; 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: 5136
diff changeset
14 ;; 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: 5136
diff changeset
15 ;; for more details.
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
16
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
17 ;; 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: 5136
diff changeset
18 ;; along with XEmacs. If not, see <http://www.gnu.org/licenses/>.
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
19
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
20 ;;; Section 0. Useful functions to construct test suites.
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
21
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
22 (defvar ccl-test-last-register-state nil)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
23
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
24 (defun ccl-test-register-ccl-program (sym prog)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
25 (let ((compiled (ccl-compile prog)))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
26 (register-ccl-program sym compiled)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
27 compiled))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
28
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
29 (defun ccl-test (prog &optional regs return-reg-idx)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
30 (ccl-test-register-ccl-program
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
31 'ccl-test prog)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
32 (cond ((< (length regs) 8)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
33 (setq ccl-test-last-register-state
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
34 (apply #'vector (append regs (make-list (- 8 (length regs)) 0)))))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
35 ((> (length regs) 8)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
36 (setq ccl-test-last-register-state
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
37 (apply #'vector (subseq regs 0 8))))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
38 (t
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
39 (setq ccl-test-last-register-state
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
40 (apply #'vector regs))))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
41 (ccl-execute
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
42 'ccl-test
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
43 ccl-test-last-register-state)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
44 (if (null return-reg-idx)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
45 (setq return-reg-idx 0))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
46 (aref ccl-test-last-register-state return-reg-idx))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
47
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
48 (defun ccl-test-on-stream (prog string
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
49 &optional not-check-coding-system)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
50 (ccl-test-register-ccl-program
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
51 'ccl-test-decoder prog)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
52 (setq ccl-test-last-register-state (make-vector 9 0))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
53 (let ((str2
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
54 (ccl-execute-on-string
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
55 'ccl-test-decoder
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
56 ccl-test-last-register-state
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
57 string)))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
58 (if (not not-check-coding-system)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
59 (Assert (string=
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
60 str2
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
61 (decode-coding-string
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
62 string 'ccl-test-coding-system))))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
63 str2))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
64
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
65 (defvar ccl-test-symbol-idx 0)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
66 (defun ccl-test-generate-symbol (idx)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
67 (intern (format "ccl-test-map-sym-%d" idx)))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
68
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
69 (defun ccl-test-construct-map-structure (maps &optional idx)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
70 (setq ccl-test-symbol-idx (if idx idx 0))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
71 (let (map result sym)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
72 (while maps
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
73 (setq map (car maps)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
74 maps (cdr maps))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
75 (cond ((vectorp map)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
76 (setq sym (ccl-test-generate-symbol
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
77 ccl-test-symbol-idx)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
78 ccl-test-symbol-idx
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
79 (1+ ccl-test-symbol-idx))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
80 (register-code-conversion-map
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
81 sym map)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
82 (set sym map)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
83 (setq result (cons sym result)))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
84
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
85 ((symbolp map)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
86 (setq result (cons sym result)))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
87
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
88 ((consp map)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
89 (setq result
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
90 (cons (ccl-test-construct-map-structure
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
91 map ccl-test-symbol-idx)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
92 result)))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
93 (t
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
94 (error "Unknown data:%S" map))))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
95 (nreverse result)))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
96
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
97 (defun ccl-test-map-multiple (val maps)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
98 (ccl-test
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
99 `(0 ((map-multiple
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
100 r1 r0
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
101 ,(ccl-test-construct-map-structure maps))))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
102 (list val))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
103 (cons (aref ccl-test-last-register-state 0)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
104 (aref ccl-test-last-register-state 1)))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
105
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
106 (defun ccl-test-iterate-multiple-map (val maps)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
107 (ccl-test
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
108 `(0 ((iterate-multiple-map
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
109 r1 r0
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
110 ,@(ccl-test-construct-map-structure maps))))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
111 (list val))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
112 (cons (aref ccl-test-last-register-state 0)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
113 (aref ccl-test-last-register-state 1)))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
114
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
115 (defun ccl-test-setup ()
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
116 (define-ccl-program
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
117 ccl-test-decoder
4573
baf6c66f6f47 Correct the CCL programs used by the coding system in ccl-tests.el.
Aidan Kehoe <kehoea@parhasard.net>
parents: 771
diff changeset
118 '(1 (loop
baf6c66f6f47 Correct the CCL programs used by the coding system in ccl-tests.el.
Aidan Kehoe <kehoea@parhasard.net>
parents: 771
diff changeset
119 (read r0)
baf6c66f6f47 Correct the CCL programs used by the coding system in ccl-tests.el.
Aidan Kehoe <kehoea@parhasard.net>
parents: 771
diff changeset
120 (write-repeat r0))))
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
121 (define-ccl-program
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
122 ccl-test-encoder
4573
baf6c66f6f47 Correct the CCL programs used by the coding system in ccl-tests.el.
Aidan Kehoe <kehoea@parhasard.net>
parents: 771
diff changeset
123 '(1 (loop
baf6c66f6f47 Correct the CCL programs used by the coding system in ccl-tests.el.
Aidan Kehoe <kehoea@parhasard.net>
parents: 771
diff changeset
124 (read r0)
baf6c66f6f47 Correct the CCL programs used by the coding system in ccl-tests.el.
Aidan Kehoe <kehoea@parhasard.net>
parents: 771
diff changeset
125 (write-repeat r0))))
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 444
diff changeset
126 (or (find-coding-system 'ccl-test-coding-system)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 444
diff changeset
127 (make-coding-system
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 444
diff changeset
128 'ccl-test-coding-system
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 444
diff changeset
129 'ccl
4573
baf6c66f6f47 Correct the CCL programs used by the coding system in ccl-tests.el.
Aidan Kehoe <kehoea@parhasard.net>
parents: 771
diff changeset
130 "CCL TEST temporary coding-system."
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 444
diff changeset
131 '(mnemonic "CCL-TEST"
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 444
diff changeset
132 eol-type lf
4715
a357478dd457 Fix some test failures, mule-tests.el.
Aidan Kehoe <kehoea@parhasard.net>
parents: 4573
diff changeset
133 safe-charsets t
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 444
diff changeset
134 decode ccl-test-decoder
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 444
diff changeset
135 encode ccl-test-encoder))))
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
136
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
137 ;;; Section 1. arithmetic operations.
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
138
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
139 (defun ccl-test-normal-expr ()
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
140 ;; normal-expr
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
141 (let ((r0 0) (r1 10) (r2 20) (r3 21) (r4 7))
5136
0f66906b6e37 Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents: 4855
diff changeset
142 (Assert (= (ccl-test '(0 ((r0 = ((((r1 * r2) + r3) % r4) << 2))))
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
143 (list r0 r1 r2 r3 r4))
5136
0f66906b6e37 Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents: 4855
diff changeset
144 (ash (% (+ (* r1 r2) r3) r4) 2))))
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
145
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
146 (Assert (\= (ccl-test '(0 ((r2 = (r1 < 10))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
147 (r0 = (r2 > 10))))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
148 '(0 5))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
149 0))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
150
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
151 (let ((r0 0) (r1 #x10FF) (r2 #xCC) (r3 #xE0))
5136
0f66906b6e37 Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents: 4855
diff changeset
152 (Assert (= (ccl-test '(0 ((r0 = (((r1 & #xFF) ^ r2) | r3))))
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
153 (list r0 r1 r2 r3))
5136
0f66906b6e37 Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents: 4855
diff changeset
154 (logior (logxor (logand r1 #xFF) r2) r3))))
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
155
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
156 ;; checking range of SJIS
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
157 ;; 81(40-7E, 80-FC), 82, 9F, E0, E1, EF
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
158
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
159 (let ((hs '(#x81 #x82 #x9F #xE0 #xE1 #xEF))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
160 func high low)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
161 (setq func
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
162 (lambda (high low)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
163 (let (ch c1 c2)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
164 (setq ch (split-char (decode-shift-jis-char
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
165 (cons high low))))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
166 (setq c1 (nth 1 ch)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
167 c2 (nth 2 ch))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
168 (ccl-test '(0 ((r0 = (r1 de-sjis r2))))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
169 (list 0 high low))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
170 (Assert (and (= c1 (aref ccl-test-last-register-state 0))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
171 (= c2 (aref ccl-test-last-register-state 7))))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
172 (ccl-test '(0 ((r0 = (r1 en-sjis r2))))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
173 (list 0 c1 c2))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
174 (Assert (and (= high (aref ccl-test-last-register-state 0))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
175 (= low (aref ccl-test-last-register-state 7)))))))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
176 (while (setq high (car hs))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
177 (setq hs (cdr hs))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
178 (setq low #x40)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
179 (while (<= low #x7E)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
180 (funcall func high low)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
181 (setq low (1+ low)))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
182 (setq low #x80)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
183 (while (<= low #xFC)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
184 (funcall func high low)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
185 (setq low (1+ low)))))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
186
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
187 ;; self-expr
5136
0f66906b6e37 Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents: 4855
diff changeset
188 (Assert (= (ccl-test '(0 ((r0 += 20)
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
189 (r0 *= 40)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
190 (r0 -= 15)))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
191 '(100))
5136
0f66906b6e37 Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents: 4855
diff changeset
192 (- (* (+ 100 20) 40) 15)))
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
193
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
194 ;; ref. array
5136
0f66906b6e37 Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents: 4855
diff changeset
195 (Assert (= (ccl-test '(0 ((r0 = r0 [100 101 102 103 104])))
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
196 '(3))
5136
0f66906b6e37 Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents: 4855
diff changeset
197 103)))
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
198
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
199 ;;; Section 2. Simple read and write
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
200 (defun ccl-test-simple-read-and-write ()
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
201 ;; constant
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
202 (let* ((str "1234567890abcdefghij")
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
203 (dum (make-string 1 ?X)))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
204 (Assert
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
205 (string= (ccl-test-on-stream
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
206 `(,(length str)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
207 ((loop (read r0) (write ,str)))) dum)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
208 str)))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
209 ;; register
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
210 (let* ((str "1234567890abcdefghij"))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
211 (Assert
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
212 (string= (ccl-test-on-stream `(1 ((read r0)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
213 (loop
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
214 (write r0)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
215 (read r0)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
216 (repeat))))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
217 str)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
218 str))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
219 (Assert
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
220 (string= (ccl-test-on-stream `(1 ((read r0)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
221 (loop
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
222 (write-read-repeat r0))))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
223 str)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
224 str)))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
225
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
226 ;; expression
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
227 (let ((str "1234567890abcdefghij")
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
228 str2 i len)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
229 (setq str2 ""
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
230 len (length str)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
231 i 0)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
232 (while (< i len)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
233 (setq str2 (concat str2 (char-to-string
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
234 (+ (char-to-int (aref str i)) 3))))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
235 (setq i (1+ i)))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
236 (Assert
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
237 (string= (ccl-test-on-stream `(1 ((read r0)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
238 (loop
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
239 (write (r0 + 3))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
240 (read r0)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
241 (repeat))))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
242 str)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
243 str2))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
244 (Assert
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
245 (string= (ccl-test-on-stream `(1 ((read r0)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
246 (loop
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
247 (r0 += 3)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
248 (write-read-repeat r0))))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
249 str)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
250 str2)))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
251
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
252
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
253 ;; write via array
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
254 (let* ((str (mapconcat (lambda (x) (char-to-string (int-to-char x)))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
255 '(0 1 2 3 4 5 6) "")))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
256 (Assert
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
257 (string= (ccl-test-on-stream
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
258 `(1 ((read r0)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
259 (loop
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
260 (write r0
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
261 ,(vector (make-char 'japanese-jisx0208 36 34)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
262 (make-char 'japanese-jisx0208 36 36)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
263 (make-char 'japanese-jisx0208 36 38)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
264 (make-char 'japanese-jisx0208 36 40)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
265 (make-char 'japanese-jisx0208 36 42)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
266 (make-char 'japanese-jisx0208 36 43)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
267 (make-char 'japanese-jisx0208 36 45)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
268 (make-char 'japanese-jisx0208 36 47)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
269 (make-char 'japanese-jisx0208 36 49)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
270 (make-char 'japanese-jisx0208 36 51)))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
271 (read r0)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
272 (repeat))))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
273 str t)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
274 (mapconcat #'char-to-string
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
275 (list (make-char 'japanese-jisx0208 36 34)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
276 (make-char 'japanese-jisx0208 36 36)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
277 (make-char 'japanese-jisx0208 36 38)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
278 (make-char 'japanese-jisx0208 36 40)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
279 (make-char 'japanese-jisx0208 36 42)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
280 (make-char 'japanese-jisx0208 36 43)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
281 (make-char 'japanese-jisx0208 36 45))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
282 "")))))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
283
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
284 ;;; Section 3. read-multibyte-character, and write-multibyte-character
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
285 (defun ccl-test-read-write-multibyte-character ()
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
286 ;; simple test.
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
287 (let* ((str (concat "LMDXXX..."
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
288 (mapconcat #'char-to-string
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
289 (list (make-char 'japanese-jisx0208 36 36)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
290 (make-char 'japanese-jisx0208 36 36)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
291 (make-char 'japanese-jisx0208 50 67)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
292 (make-char 'japanese-jisx0208 56 58)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
293 (make-char 'japanese-jisx0208 72 104)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
294 (make-char 'japanese-jisx0208 36 108)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
295 (make-char 'japanese-jisx0208 36 70)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
296 (make-char 'japanese-jisx0208 36 45)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
297 (make-char 'japanese-jisx0208 36 63)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
298 (make-char 'japanese-jisx0208 33 35))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
299 "")
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
300 "...")))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
301 (Assert
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
302 (string=
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
303 (ccl-test-on-stream
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
304 `(1 ((loop
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
305 (read-multibyte-character r0 r1)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
306 (write-multibyte-character r0 r1)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
307 (repeat))))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
308 str t)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
309 str)))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
310 ;;
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
311 )
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
312
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
313 ;;; Section 4. CCL call
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
314 (defun ccl-test-ccl-call ()
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
315 ;; set up
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
316 (define-ccl-program
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
317 ccl-test-sub1
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
318 '(0
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
319 ((r5 = ?z))))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
320 (define-ccl-program
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
321 ccl-test-sub2
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
322 '(0
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
323 ((call ccl-test-sub1)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
324 (r0 = (r5 * 20)))))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
325 (define-ccl-program
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
326 ccl-test-sub3
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
327 '(1
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
328 ((call ccl-test-sub2)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
329 (write r5)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
330 (write (r0 / 20)))))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
331 (Assert (string=
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
332 (ccl-test-on-stream
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
333 '(1 ((loop (read r0) (call ccl-test-sub3))))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
334 "A")
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
335 "zz")))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
336
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
337 ;;; Section 5. Map-instructions
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
338 (defun ccl-test-map-instructions ()
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
339 ;; set up
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
340 (define-ccl-program
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
341 ccl-test-arith-1
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
342 '(0
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
343 ((r0 += 1000000))))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
344
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
345 (define-ccl-program
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
346 ccl-test-lambda
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
347 '(0
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
348 ((r0 = -3))))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
349
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
350 (define-ccl-program
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
351 ccl-test-t
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
352 '(0
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
353 ((r0 = -2))))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
354
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
355 (define-ccl-program
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
356 ccl-test-nil
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
357 '(0
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
358 ((r0 = -1))))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
359
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
360 ;; 1-level normal 1 mapping
5136
0f66906b6e37 Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents: 4855
diff changeset
361 (Assert (equal
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
362 (mapcar
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
363 (lambda (val)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
364 (ccl-test-map-multiple
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
365 val
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
366 '([100 1 2 3 4 5])))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
367 '(0 99 100 101 102 103 104 105 106 107))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
368 '((0 . -1) (99 . -1)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
369 (1 . 0) (2 . 0) (3 . 0) (4 . 0) (5 . 0)
5136
0f66906b6e37 Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents: 4855
diff changeset
370 (105 . -1) (106 . -1) (107 . -1))))
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
371
5136
0f66906b6e37 Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents: 4855
diff changeset
372 (Assert (equal
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
373 (mapcar
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
374 (lambda (val)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
375 (ccl-test-iterate-multiple-map
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
376 val
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
377 '([100 1 2 3 4 5])))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
378 '(0 99 100 101 102 103 104 105 106 107))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
379 '((0 . -1) (99 . -1)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
380 (1 . 0) (2 . 0) (3 . 0) (4 . 0) (5 . 0)
5136
0f66906b6e37 Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents: 4855
diff changeset
381 (105 . -1) (106 . -1) (107 . -1))))
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
382
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
383 ;; 1-level normal 2 mappings
5136
0f66906b6e37 Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents: 4855
diff changeset
384 (Assert (equal
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
385 (mapcar
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
386 (lambda (val)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
387 (ccl-test-map-multiple
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
388 val
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
389 '([100 1 2 nil 4 5]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
390 [101 12 13 14 15 16 17])))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
391 '(0 99 100 101 102 103 104 105 106 107))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
392 '((0 . -1) (99 . -1) (1 . 0) (2 . 0)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
393 (13 . 1) (4 . 0) (5 . 0) (16 . 1) (17 . 1)
5136
0f66906b6e37 Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents: 4855
diff changeset
394 (107 . -1))))
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
395
5136
0f66906b6e37 Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents: 4855
diff changeset
396 (Assert (equal
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
397 (mapcar
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
398 (lambda (val)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
399 (ccl-test-iterate-multiple-map
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
400 val
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
401 '([100 1 2 3 4 5]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
402 [101 12 13 14 15 16 17])))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
403 '(0 99 100 101 102 103 104 105 106 107))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
404 '((0 . -1) (99 . -1) (1 . 0) (2 . 0) (3 . 0)
5136
0f66906b6e37 Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents: 4855
diff changeset
405 (4 . 0) (5 . 0) (16 . 1) (17 . 1) (107 . -1))))
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
406
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
407
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
408 ;; 1-level normal 7 mappings
5136
0f66906b6e37 Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents: 4855
diff changeset
409 (Assert (equal
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
410 (mapcar
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
411 (lambda (val)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
412 (ccl-test-map-multiple
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
413 val
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
414 '([100 1 2 nil 4 5]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
415 [101 12 13 14 15 16 17]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
416 [1000 101 102 103 nil 105 106 nil 108]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
417 [1005 1006 1007 1008 1009 1010 1011 1012]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
418 [10005 10006 10007 10008 10009 10010 10011 10012]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
419 [20000 20000 20001 20002 nil 20004 20005 20006]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
420 [20003 30000 30010 30020 30030 30040 30050 30060]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
421 )))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
422 '(0 99 100 101 102 103 104 105 106 107
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
423 998 999 1000 1001 1002 1003 1004 1005 1006 1007
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
424 9999 10000 10001 10002 10003 10004
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
425 19999 20000 20001 20002 20003 20004
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
426 20005 20006))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
427 '((0 . -1) (99 . -1) (1 . 0) (2 . 0) (13 . 1) (4 . 0)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
428 (5 . 0) (16 . 1) (17 . 1) (107 . -1) (998 . -1)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
429 (999 . -1) (101 . 2) (102 . 2) (103 . 2) (1003 . -1)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
430 (105 . 2) (106 . 2) (1007 . 3) (108 . 2) (9999 . -1)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
431 (10000 . -1) (10001 . -1) (10002 . -1) (10003 . -1)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
432 (10004 . -1) (19999 . -1) (20000 . 5) (20001 . 5)
5136
0f66906b6e37 Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents: 4855
diff changeset
433 (20002 . 5) (30000 . 6) (20004 . 5) (20005 . 5) (20006 . 5))))
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
434
5136
0f66906b6e37 Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents: 4855
diff changeset
435 (Assert (equal
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
436 (mapcar
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
437 (lambda (val)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
438 (ccl-test-iterate-multiple-map
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
439 val
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
440 '([100 1 2 nil 4 5]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
441 [101 12 13 14 15 16 17]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
442 [1000 101 102 103 nil 105 106 nil 108]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
443 [1005 1006 1007 1008 1009 1010 1011 1012]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
444 [10005 10006 10007 10008 10009 10010 10011 10012]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
445 [20000 20000 20001 20002 nil 20004 20005 20006]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
446 [20003 30000 30010 30020 30030 30040 30050 30060]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
447 )))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
448 '(0 99 100 101 102 103 104 105 106 107
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
449 998 999 1000 1001 1002 1003 1004 1005 1006 1007
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
450 9999 10000 10001 10002 10003 10004
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
451 19999 20000 20001 20002 20003 20004
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
452 20005 20006))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
453 '((0 . -1) (99 . -1) (1 . 0) (2 . 0) (13 . 1) (4 . 0)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
454 (5 . 0) (16 . 1) (17 . 1) (107 . -1) (998 . -1)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
455 (999 . -1) (101 . 2) (102 . 2) (103 . 2) (1003 . -1)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
456 (105 . 2) (106 . 2) (1007 . 3) (108 . 2) (9999 . -1)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
457 (10000 . -1) (10001 . -1) (10002 . -1) (10003 . -1)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
458 (10004 . -1) (19999 . -1) (20000 . 5) (20001 . 5)
5136
0f66906b6e37 Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents: 4855
diff changeset
459 (20002 . 5)(30000 . 6)(20004 . 5)(20005 . 5)(20006 . 5))))
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
460
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
461 ;; 1-level 7 mappings including CCL call
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
462
5136
0f66906b6e37 Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents: 4855
diff changeset
463 (Assert (equal
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
464 (mapcar
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
465 (lambda (val)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
466 (ccl-test-map-multiple
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
467 val
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
468 '([100 1 2 nil 4 5]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
469 [101 12 13 14 15 16 17]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
470 [1000 101 ccl-test-arith-1 103 nil 105 106 ccl-test-nil 108]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
471 [1005 1006 1007 1008 1009 ccl-test-lambda 1011 1012]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
472 [10005 10006 10007 10008 10009 10010 10011 10012]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
473 [20000 20000 20001 20002 nil 20004 20005 20006]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
474 [20003 30000 30010 30020 30030 30040 30050 30060]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
475 )))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
476 '(0 99 100 101 102 103 104 105 106 107
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
477 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
478 9999 10000 10001 10002 10003 10004
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
479 19999 20000 20001 20002 20003 20004
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
480 20005 20006))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
481 '((0 . -1) (99 . -1) (1 . 0) (2 . 0) (13 . 1) (4 . 0)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
482 (5 . 0) (16 . 1) (17 . 1) (107 . -1) (998 . -1)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
483 (999 . -1) (101 . 2) (1001001 . 2) (103 . 2)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
484 (1003 . -1) (105 . 2) (106 . 2) (1007 . 3) (108 . 2)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
485 (1009 . 3) (1009 . 3) (9999 . -1) (10000 . -1)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
486 (10001 . -1) (10002 . -1) (10003 . -1) (10004 . -1)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
487 (19999 . -1) (20000 . 5) (20001 . 5) (20002 . 5)
5136
0f66906b6e37 Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents: 4855
diff changeset
488 (30000 . 6)(20004 . 5)(20005 . 5)(20006 . 5))))
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
489
5136
0f66906b6e37 Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents: 4855
diff changeset
490 (Assert (equal
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
491 (mapcar
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
492 (lambda (val)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
493 (ccl-test-iterate-multiple-map
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
494 val
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
495 '([100 1 2 nil 4 5]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
496 [101 12 13 14 15 16 17]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
497 [1000 101 ccl-test-arith-1 103 nil 105 106 ccl-test-nil 108]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
498 [1005 1006 1007 1008 1009 ccl-test-lambda 1011 1012]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
499 [10005 10006 10007 10008 10009 10010 10011 10012]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
500 [20000 20000 20001 20002 nil 20004 20005 20006]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
501 [20003 30000 30010 30020 30030 30040 30050 30060]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
502 )))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
503 '(0 99 100 101 102 103 104 105 106 107
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
504 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
505 9999 10000 10001 10002 10003 10004
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
506 19999 20000 20001 20002 20003 20004
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
507 20005 20006))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
508 '((0 . -1) (99 . -1) (1 . 0) (2 . 0) (13 . 1) (4 . 0)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
509 (5 . 0) (16 . 1) (17 . 1) (107 . -1) (998 . -1)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
510 (999 . -1) (101 . 2) (1001001 . 0) (103 . 2)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
511 (1003 . -1) (105 . 2) (106 . 2) (-1 . 0) (108 . 2)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
512 (1009 . 3) (-3 . 0) (9999 . -1) (10000 . -1)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
513 (10001 . -1) (10002 . -1) (10003 . -1) (10004 . -1)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
514 (19999 . -1) (20000 . 5) (20001 . 5) (20002 . 5)
5136
0f66906b6e37 Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents: 4855
diff changeset
515 (30000 . 6) (20004 . 5) (20005 . 5) (20006 . 5))))
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
516
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
517 ;; 3-level mappings
5136
0f66906b6e37 Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents: 4855
diff changeset
518 (Assert (equal
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
519 (mapcar
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
520 (lambda (val)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
521 (ccl-test-map-multiple
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
522 val
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
523 '([100 1 2 nil 4 5]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
524 [101 12 13 14 15 16 17]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
525 [1000 101 102 103 nil 105 106 nil 108]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
526 (([1005 1006 1007 1008 1009 1010 1011 1012]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
527 [10005 10006 20007 20008 10009 10010 10011 10012])
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
528 [20000 20000 20001 20002 nil 20004 20005 20006]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
529 [1006 2006 2007 2008 2009 2010]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
530 ([20003 30000 30010 30020 30030 30040 30050 30060]))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
531 [t t 0 1000000]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
532 [1008 1108 1109 1110 1111 1112 1113])))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
533 '(0 99 100 101 102 103 104 105 106 107
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
534 998 999 1000 1001 1002 1003 1004 1005 1006 1007
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
535 1008 1009 1010 1011 1012 1013 1014
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
536 9999 10000 10001 10002 10003 10004
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
537 10005 10006 10007 10008 10009 10010
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
538 19999 20000 20001 20002 20003 20004
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
539 20005 20006))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
540 '((0 . 11) (99 . 11) (1 . 0) (2 . 0) (13 . 1)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
541 (4 . 0) (5 . 0) (16 . 1) (17 . 1) (107 . 11)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
542 (998 . 11) (999 . 11) (101 . 2) (102 . 2)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
543 (103 . 2) (1003 . 11) (105 . 2) (106 . 2)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
544 (1006 . 11) (108 . 2) (1108 . 12) (1109 . 12)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
545 (1110 . 12) (1111 . 12) (1112 . 12) (1113 . 12)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
546 (1014 . 11) (9999 . 11) (10000 . 11) (10001 . 11)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
547 (10002 . 11) (10003 . 11) (10004 . 11) (10005 . 11)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
548 (30040 . 10) (30050 . 10) (10008 . 11) (10009 . 11)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
549 (10010 . 11) (19999 . 11) (20000 . 11) (20001 . 11)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
550 (20002 . 11) (20003 . 11) (20004 . 11) (20005 . 11)
5136
0f66906b6e37 Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents: 4855
diff changeset
551 (20006 . 11))))
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
552
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
553
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
554 ;; 3-level mappings including CCL call
5136
0f66906b6e37 Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents: 4855
diff changeset
555 (Assert (equal
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
556 (mapcar
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
557 (lambda (val)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
558 (ccl-test-map-multiple
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
559 val
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
560 '([100 1 2 nil 4 5]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
561 [101 12 13 14 15 16 17]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
562 [1000 101 102 103 nil ccl-test-arith-1 106 nil 108]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
563 (([1005 1006 1007 1008 1009 1010 1011 ccl-test-arith-1
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
564 70 71 72 73]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
565 [10005 10006 20007 20008 10009 10010 10011 10012])
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
566 [70 ccl-test-t ccl-test-lambda ccl-test-nil ccl-test-nil]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
567 [72 lambda]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
568 [20000 20000 20001 20002 nil 20004 20005 20006]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
569 [1006 2006 2007 2008 2009 2010]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
570 ([20003 30000 30010 ccl-test-arith-1 30030 30040
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
571 ccl-test-arith-1 30060]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
572 [1001010 50 51 52 53 54 55]))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
573 [t t 0 1000000]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
574 [t ccl-test-arith-1 0 10]
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
575 [1008 1108 1109 1110 1111 1112 1113])))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
576 '(0 99 100 101 102 103 104 105 106 107
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
577 998 999 1000 1001 1002 1003 1004 1005 1006 1007
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
578 1008 1009 1010 1011 1012 1013 1014 1015 1016
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
579 9999 10000 10001 10002 10003 10004
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
580 10005 10006 10007 10008 10009 10010
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
581 19999 20000 20001 20002 20003 20004
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
582 20005 20006))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
583 '((1000000 . 15) (99 . 14) (1 . 0) (2 . 0) (13 . 1)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
584 (4 . 0) (5 . 0) (16 . 1) (17 . 1) (107 . 14) (998 . 14)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
585 (999 . 14) (101 . 2) (102 . 2) (103 . 2) (1003 . 14)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
586 (1001004 . 2) (106 . 2) (1006 . 14) (108 . 2) (1108 . 16)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
587 (1109 . 16) (1110 . 16) (51 . 13) (1112 . 16) (71 . 7)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
588 (72 . 8) (1015 . 14) (1016 . 14) (9999 . 14) (10000 . 14)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
589 (10001 . 14) (10002 . 14) (10003 . 14) (10004 . 14)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
590 (10005 . 14) (30040 . 12) (1020008 . 12) (10008 . 14)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
591 (10009 . 14) (10010 . 14) (19999 . 14) (20000 . 14)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
592 (20001 . 14) (20002 . 14) (20003 . 14) (20004 . 14)
5136
0f66906b6e37 Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically
Ben Wing <ben@xemacs.org>
parents: 4855
diff changeset
593 (20005 . 14) (20006 . 14))))
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
594 ;; All map-instruction tests ends here.
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
595 )
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
596
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
597 (defun ccl-test-suites ()
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
598 (ccl-test-setup)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
599 (ccl-test-normal-expr)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
600 (ccl-test-simple-read-and-write)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
601 (ccl-test-read-write-multibyte-character)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
602 (ccl-test-ccl-call)
4573
baf6c66f6f47 Correct the CCL programs used by the coding system in ccl-tests.el.
Aidan Kehoe <kehoea@parhasard.net>
parents: 771
diff changeset
603 (ccl-test-map-instructions)
baf6c66f6f47 Correct the CCL programs used by the coding system in ccl-tests.el.
Aidan Kehoe <kehoea@parhasard.net>
parents: 771
diff changeset
604 ;; Re-initialise the coding system:
baf6c66f6f47 Correct the CCL programs used by the coding system in ccl-tests.el.
Aidan Kehoe <kehoea@parhasard.net>
parents: 771
diff changeset
605 (ccl-test-setup))
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
606
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
607 ;;; start tests only when ccl-execute is enabled.
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
608 (if (fboundp 'ccl-execute)
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
609 (ccl-test-suites))
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
610
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents:
diff changeset
611 ;;; ccl-test.el ends here.