annotate tests/automated/ccl-tests.el @ 4855:189fb67ca31a

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