32
;; These tests are passed at revision 5329 (new repository)
36
(require "test/uim-test-utils")
38
(define-uim-test-case "testcase ustr"
41
(uim '(require "ustr.scm"))
42
(uim '(define-record 'ja-kana
46
(uim '(define ustr-f (ustr-new '(("h" . "H") ("e" . "E") ("l" . "L")
47
("l" . "L") ("o" . "O")))))
48
(uim '(define ustr-fl (ustr-new '(("h" . "H") ("e" . "E") ("l" . "L"))
49
'(("l" . "L") ("o" . "O")))))
50
(uim '(define ustr-l (ustr-new ()
51
'(("h" . "H") ("e" . "E") ("l" . "L")
52
("l" . "L") ("o" . "O")))))
53
(uim '(define ustra-f (ustr-new '("h" "e" "l" "l" "o"))))
54
(uim '(define ustra-fl (ustr-new '("h" "e" "l")
56
(uim '(define ustra-l (ustr-new ()
57
'("h" "e" "l" "l" "o"))))
58
(uim '(define ustrj-f (ustr-new '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ")
59
("ん" "ン" "ン") ("ご" "ゴ" "ゴ")
61
(uim '(define ustrj-fl (ustr-new '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ")
63
'(("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ")))))
64
(uim '(define ustrj-l (ustr-new ()
65
'(("に" "ニ" "ニ") ("ほ" "ホ" "ホ")
66
("ん" "ン" "ン") ("ご" "ゴ" "ゴ")
68
(uim '(define ustre (ustr-new ())))))
71
;; single sequence goes into former
72
(assert-equal '(("o" "l" "l" "e" "h") ())
73
(uim '(ustr-new '("h" "e" "l" "l" "o"))))
74
;; dual sequences are go into former and latter
75
(assert-equal '(("l" "e" "h") ("l" "o"))
76
(uim '(ustr-new '("h" "e" "l")
78
;; latter sequence only
79
(assert-equal '(() ("h" "e" "l" "l" "o"))
81
'("h" "e" "l" "l" "o")))))
83
("test ustr-whole-seq"
84
(assert-equal '(("h" . "H") ("e" . "E") ("l" . "L") ("l" . "L") ("o" . "O"))
85
(uim '(ustr-whole-seq ustr-fl)))
86
(assert-equal '(("h" . "H") ("e" . "E") ("l" . "L") ("l" . "L") ("o" . "O"))
87
(uim '(ustr-whole-seq ustr-f)))
88
(assert-equal '(("h" . "H") ("e" . "E") ("l" . "L") ("l" . "L") ("o" . "O"))
89
(uim '(ustr-whole-seq ustr-l)))
90
(assert-equal '("h" "e" "l" "l" "o")
91
(uim '(ustr-whole-seq ustra-fl)))
92
(assert-equal '("h" "e" "l" "l" "o")
93
(uim '(ustr-whole-seq ustra-f)))
94
(assert-equal '("h" "e" "l" "l" "o")
95
(uim '(ustr-whole-seq ustra-l)))
96
(assert-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
97
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
98
(uim '(ustr-whole-seq ustrj-fl)))
99
(assert-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
100
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
101
(uim '(ustr-whole-seq ustrj-f)))
102
(assert-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
103
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
104
(uim '(ustr-whole-seq ustrj-l))))
106
("test ustr-former-seq"
107
(assert-equal '(("h" . "H") ("e" . "E") ("l" . "L"))
108
(uim '(ustr-former-seq ustr-fl)))
109
(assert-equal '(("h" . "H") ("e" . "E") ("l" . "L") ("l" . "L") ("o" . "O"))
110
(uim '(ustr-former-seq ustr-f)))
112
(uim '(ustr-former-seq ustr-l)))
113
(assert-equal '("h" "e" "l")
114
(uim '(ustr-former-seq ustra-fl)))
115
(assert-equal '("h" "e" "l" "l" "o")
116
(uim '(ustr-former-seq ustra-f)))
118
(uim '(ustr-former-seq ustra-l)))
119
(assert-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン"))
120
(uim '(ustr-former-seq ustrj-fl)))
121
(assert-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
122
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
123
(uim '(ustr-former-seq ustrj-f)))
125
(uim '(ustr-former-seq ustrj-l))))
127
("test ustr-latter-seq"
128
(assert-equal '(("l" . "L") ("o" . "O"))
129
(uim '(ustr-latter-seq ustr-fl)))
131
(uim '(ustr-latter-seq ustr-f)))
132
(assert-equal '(("h" . "H") ("e" . "E") ("l" . "L") ("l" . "L") ("o" . "O"))
133
(uim '(ustr-latter-seq ustr-l)))
134
(assert-equal '("l" "o")
135
(uim '(ustr-latter-seq ustra-fl)))
137
(uim '(ustr-latter-seq ustra-f)))
138
(assert-equal '("h" "e" "l" "l" "o")
139
(uim '(ustr-latter-seq ustra-l)))
140
(assert-equal '(("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
141
(uim '(ustr-latter-seq ustrj-fl)))
143
(uim '(ustr-latter-seq ustrj-f)))
144
(assert-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
145
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
146
(uim '(ustr-latter-seq ustrj-l))))
148
("test ustr-set-whole-seq!"
150
(assert-equal '("h" "e" "l" "l" "o")
151
(uim '(ustr-whole-seq ustra-fl)))
152
(assert-equal '("h" "e" "l")
153
(uim '(ustr-former-seq ustra-fl)))
154
(assert-equal '("l" "o")
155
(uim '(ustr-latter-seq ustra-fl)))
156
(uim '(ustr-set-whole-seq! ustra-fl '("w" "o" "r" "L" "d")))
157
(assert-equal '("w" "o" "r" "L" "d")
158
(uim '(ustr-whole-seq ustra-fl)))
159
(assert-equal '("w" "o" "r" "L" "d")
160
(uim '(ustr-former-seq ustra-fl)))
162
(uim '(ustr-latter-seq ustra-fl)))
164
(assert-equal '("h" "e" "l" "l" "o")
165
(uim '(ustr-whole-seq ustra-f)))
166
(assert-equal '("h" "e" "l" "l" "o")
167
(uim '(ustr-former-seq ustra-f)))
169
(uim '(ustr-latter-seq ustra-f)))
170
(uim '(ustr-set-whole-seq! ustra-f '("w" "o" "r" "L" "d")))
171
(assert-equal '("w" "o" "r" "L" "d")
172
(uim '(ustr-whole-seq ustra-f)))
173
(assert-equal '("w" "o" "r" "L" "d")
174
(uim '(ustr-former-seq ustra-f)))
176
(uim '(ustr-latter-seq ustra-f)))
178
(assert-equal '("h" "e" "l" "l" "o")
179
(uim '(ustr-whole-seq ustra-l)))
181
(uim '(ustr-former-seq ustra-l)))
182
(assert-equal '("h" "e" "l" "l" "o")
183
(uim '(ustr-latter-seq ustra-l)))
184
(uim '(ustr-set-whole-seq! ustra-l '("w" "o" "r" "L" "d")))
185
(assert-equal '("w" "o" "r" "L" "d")
186
(uim '(ustr-whole-seq ustra-l)))
187
(assert-equal '("w" "o" "r" "L" "d")
188
(uim '(ustr-former-seq ustra-l)))
190
(uim '(ustr-latter-seq ustra-l))))
192
("test ustr-set-former-seq!"
194
(assert-equal '("h" "e" "l" "l" "o")
195
(uim '(ustr-whole-seq ustra-fl)))
196
(assert-equal '("h" "e" "l")
197
(uim '(ustr-former-seq ustra-fl)))
198
(assert-equal '("l" "o")
199
(uim '(ustr-latter-seq ustra-fl)))
200
(uim '(ustr-set-former-seq! ustra-fl '("w" "o" "r" "L" "d")))
201
(assert-equal '("w" "o" "r" "L" "d" "l" "o")
202
(uim '(ustr-whole-seq ustra-fl)))
203
(assert-equal '("w" "o" "r" "L" "d")
204
(uim '(ustr-former-seq ustra-fl)))
205
(assert-equal '("l" "o")
206
(uim '(ustr-latter-seq ustra-fl)))
208
(assert-equal '("h" "e" "l" "l" "o")
209
(uim '(ustr-whole-seq ustra-f)))
210
(assert-equal '("h" "e" "l" "l" "o")
211
(uim '(ustr-former-seq ustra-f)))
213
(uim '(ustr-latter-seq ustra-f)))
214
(uim '(ustr-set-former-seq! ustra-f '("w" "o" "r" "L" "d")))
215
(assert-equal '("w" "o" "r" "L" "d")
216
(uim '(ustr-whole-seq ustra-f)))
217
(assert-equal '("w" "o" "r" "L" "d")
218
(uim '(ustr-former-seq ustra-f)))
220
(uim '(ustr-latter-seq ustra-f)))
222
(assert-equal '("h" "e" "l" "l" "o")
223
(uim '(ustr-whole-seq ustra-l)))
225
(uim '(ustr-former-seq ustra-l)))
226
(assert-equal '("h" "e" "l" "l" "o")
227
(uim '(ustr-latter-seq ustra-l)))
228
(uim '(ustr-set-former-seq! ustra-l '("w" "o" "r" "L" "d")))
229
(assert-equal '("w" "o" "r" "L" "d" "h" "e" "l" "l" "o")
230
(uim '(ustr-whole-seq ustra-l)))
231
(assert-equal '("w" "o" "r" "L" "d")
232
(uim '(ustr-former-seq ustra-l)))
233
(assert-equal '("h" "e" "l" "l" "o")
234
(uim '(ustr-latter-seq ustra-l))))
236
("test ustr-set-latter-seq!"
238
(assert-equal '("h" "e" "l" "l" "o")
239
(uim '(ustr-whole-seq ustra-fl)))
240
(assert-equal '("h" "e" "l")
241
(uim '(ustr-former-seq ustra-fl)))
242
(assert-equal '("l" "o")
243
(uim '(ustr-latter-seq ustra-fl)))
244
(uim '(ustr-set-latter-seq! ustra-fl '("w" "o" "r" "L" "d")))
245
(assert-equal '("h" "e" "l" "w" "o" "r" "L" "d")
246
(uim '(ustr-whole-seq ustra-fl)))
247
(assert-equal '("h" "e" "l")
248
(uim '(ustr-former-seq ustra-fl)))
249
(assert-equal '("w" "o" "r" "L" "d")
250
(uim '(ustr-latter-seq ustra-fl)))
252
(assert-equal '("h" "e" "l" "l" "o")
253
(uim '(ustr-whole-seq ustra-f)))
254
(assert-equal '("h" "e" "l" "l" "o")
255
(uim '(ustr-former-seq ustra-f)))
257
(uim '(ustr-latter-seq ustra-f)))
258
(uim '(ustr-set-latter-seq! ustra-f '("w" "o" "r" "L" "d")))
259
(assert-equal '("h" "e" "l" "l" "o" "w" "o" "r" "L" "d")
260
(uim '(ustr-whole-seq ustra-f)))
261
(assert-equal '("h" "e" "l" "l" "o")
262
(uim '(ustr-former-seq ustra-f)))
263
(assert-equal '("w" "o" "r" "L" "d")
264
(uim '(ustr-latter-seq ustra-f)))
266
(assert-equal '("h" "e" "l" "l" "o")
267
(uim '(ustr-whole-seq ustra-l)))
269
(uim '(ustr-former-seq ustra-l)))
270
(assert-equal '("h" "e" "l" "l" "o")
271
(uim '(ustr-latter-seq ustra-l)))
272
(uim '(ustr-set-latter-seq! ustra-l '("w" "o" "r" "L" "d")))
273
(assert-equal '("w" "o" "r" "L" "d")
274
(uim '(ustr-whole-seq ustra-l)))
276
(uim '(ustr-former-seq ustra-l)))
277
(assert-equal '("w" "o" "r" "L" "d")
278
(uim '(ustr-latter-seq ustra-l))))
281
(assert-false (uim-bool '(ustr-empty? ustr-fl)))
282
(assert-false (uim-bool '(ustr-empty? ustr-f)))
283
(assert-false (uim-bool '(ustr-empty? ustr-l)))
285
(assert-false (uim-bool '(ustr-empty? ustra-fl)))
286
(assert-false (uim-bool '(ustr-empty? ustra-f)))
287
(assert-false (uim-bool '(ustr-empty? ustra-l)))
289
(assert-false (uim-bool '(ustr-empty? ustrj-fl)))
290
(assert-false (uim-bool '(ustr-empty? ustrj-f)))
291
(assert-false (uim-bool '(ustr-empty? ustrj-l)))
293
(assert-equal '(() ())
295
(assert-true (uim-bool '(ustr-empty? ustre))))
298
(assert-false (uim-bool '(ustr-empty? ustra-fl)))
299
(uim '(ustr-clear! ustra-fl))
300
(assert-true (uim-bool '(ustr-empty? ustra-fl)))
302
(assert-false (uim-bool '(ustr-empty? ustra-f)))
303
(uim '(ustr-clear! ustra-f))
304
(assert-true (uim-bool '(ustr-empty? ustra-f)))
306
(assert-false (uim-bool '(ustr-empty? ustra-l)))
307
(uim '(ustr-clear! ustra-l))
308
(assert-true (uim-bool '(ustr-empty? ustra-l)))
310
(assert-true (uim-bool '(ustr-empty? ustre)))
311
(uim '(ustr-clear! ustre))
312
(assert-true (uim-bool '(ustr-empty? ustre))))
314
("test ustr-clear-former!"
315
(assert-false (uim-bool '(ustr-empty? ustra-fl)))
316
(uim '(ustr-clear-former! ustra-fl))
317
(assert-false (uim-bool '(ustr-empty? ustra-fl)))
319
(assert-false (uim-bool '(ustr-empty? ustra-f)))
320
(uim '(ustr-clear-former! ustra-f))
321
(assert-true (uim-bool '(ustr-empty? ustra-f)))
323
(assert-false (uim-bool '(ustr-empty? ustra-l)))
324
(uim '(ustr-clear-former! ustra-l))
325
(assert-false (uim-bool '(ustr-empty? ustra-l)))
327
(assert-true (uim-bool '(ustr-empty? ustre)))
328
(uim '(ustr-clear-former! ustre))
329
(assert-true (uim-bool '(ustr-empty? ustre))))
331
("test ustr-clear-latter!"
332
(assert-false (uim-bool '(ustr-empty? ustra-fl)))
333
(uim '(ustr-clear-latter! ustra-fl))
334
(assert-false (uim-bool '(ustr-empty? ustra-fl)))
336
(assert-false (uim-bool '(ustr-empty? ustra-f)))
337
(uim '(ustr-clear-latter! ustra-f))
338
(assert-false (uim-bool '(ustr-empty? ustra-f)))
340
(assert-false (uim-bool '(ustr-empty? ustra-l)))
341
(uim '(ustr-clear-latter! ustra-l))
342
(assert-true (uim-bool '(ustr-empty? ustra-l)))
344
(assert-true (uim-bool '(ustr-empty? ustre)))
345
(uim '(ustr-clear-latter! ustre))
346
(assert-true (uim-bool '(ustr-empty? ustre))))
349
(assert-false (uim-bool '(equal? ustr-fl ustra-fl)))
350
(uim '(ustr-copy! ustr-fl ustra-fl))
351
(assert-true (uim-bool '(equal? ustr-fl ustra-fl)))
353
(assert-false (uim-bool '(equal? ustr-f ustra-f)))
354
(uim '(ustr-copy! ustr-f ustra-f))
355
(assert-true (uim-bool '(equal? ustr-f ustra-f)))
357
(assert-false (uim-bool '(equal? ustr-l ustra-l)))
358
(uim '(ustr-copy! ustr-l ustra-l))
359
(assert-true (uim-bool '(equal? ustr-l ustra-l))))
362
(assert-true (uim-bool '(ustr= equal? ustr-fl ustr-fl)))
363
(assert-true (uim-bool '(ustr= equal? ustr-fl ustr-f)))
364
(assert-true (uim-bool '(ustr= equal? ustr-f ustr-fl)))
365
(assert-true (uim-bool '(ustr= equal? ustr-fl ustr-l)))
366
(assert-true (uim-bool '(ustr= equal? ustr-l ustr-fl)))
367
(assert-true (uim-bool '(ustr= equal? ustr-f ustr-f)))
368
(assert-true (uim-bool '(ustr= equal? ustr-l ustr-f)))
369
(assert-true (uim-bool '(ustr= equal? ustr-f ustr-l)))
370
(assert-true (uim-bool '(ustr= equal? ustr-l ustr-l)))
371
(assert-false (uim-bool '(ustr= equal? ustr-l ustre)))
372
(assert-false (uim-bool '(ustr= equal? ustre ustr-l)))
374
(assert-true (uim-bool '(ustr= string=? ustra-fl ustra-fl)))
375
(assert-true (uim-bool '(ustr= string=? ustra-fl ustra-f)))
376
(assert-true (uim-bool '(ustr= string=? ustra-f ustra-fl)))
377
(assert-true (uim-bool '(ustr= string=? ustra-fl ustra-l)))
378
(assert-true (uim-bool '(ustr= string=? ustra-l ustra-fl)))
379
(assert-true (uim-bool '(ustr= string=? ustra-f ustra-f)))
380
(assert-true (uim-bool '(ustr= string=? ustra-l ustra-f)))
381
(assert-true (uim-bool '(ustr= string=? ustra-f ustra-l)))
382
(assert-true (uim-bool '(ustr= string=? ustra-l ustra-l)))
383
(assert-false (uim-bool '(ustr= string=? ustra-fl ustre)))
384
(assert-false (uim-bool '(ustr= string=? ustre ustra-fl)))
385
(assert-false (uim-bool '(ustr= string=? ustra-f ustre)))
386
(assert-false (uim-bool '(ustr= string=? ustre ustra-f)))
387
(assert-false (uim-bool '(ustr= string=? ustra-l ustre)))
388
(assert-false (uim-bool '(ustr= string=? ustre ustra-l)))
389
(uim '(ustr-set-former-seq! ustra-f '("h" "e" "l" "l" "o" "!")))
390
(assert-false (uim-bool '(ustr= string=? ustra-fl ustra-f)))
391
(assert-false (uim-bool '(ustr= string=? ustra-f ustra-fl)))
392
(assert-false (uim-bool '(ustr= string=? ustra-l ustra-f)))
393
(assert-false (uim-bool '(ustr= string=? ustra-f ustra-l)))
394
(assert-true (uim-bool '(ustr= string=? ustra-f ustra-f)))
396
(assert-true (uim-bool '(ustr= equal? ustrj-fl ustrj-fl)))
397
(assert-true (uim-bool '(ustr= equal? ustrj-fl ustrj-f)))
398
(assert-true (uim-bool '(ustr= equal? ustrj-f ustrj-fl)))
399
(assert-true (uim-bool '(ustr= equal? ustrj-fl ustrj-l)))
400
(assert-true (uim-bool '(ustr= equal? ustrj-l ustrj-fl)))
401
(assert-true (uim-bool '(ustr= equal? ustrj-f ustrj-f)))
402
(assert-true (uim-bool '(ustr= equal? ustrj-l ustrj-f)))
403
(assert-true (uim-bool '(ustr= equal? ustrj-f ustrj-l)))
404
(assert-true (uim-bool '(ustr= equal? ustrj-l ustrj-l)))
405
(assert-false (uim-bool '(ustr= equal? ustrj-l ustre)))
406
(assert-false (uim-bool '(ustr= equal? ustre ustrj-l))))
410
(uim '(ustr-length ustr-fl)))
412
(uim '(ustr-length ustr-f)))
414
(uim '(ustr-length ustr-l)))
416
(uim '(ustr-length ustra-fl)))
418
(uim '(ustr-length ustra-f)))
420
(uim '(ustr-length ustra-l)))
422
(uim '(ustr-length ustrj-fl)))
424
(uim '(ustr-length ustrj-f)))
426
(uim '(ustr-length ustrj-l)))
428
(uim '(ustr-length ustre))))
432
(uim '(ustr-nth ustra-fl 0)))
434
(uim '(ustr-nth ustra-fl 1)))
436
(uim '(ustr-nth ustra-fl 2)))
438
(uim '(ustr-nth ustra-fl 3)))
440
(uim '(ustr-nth ustra-fl 4)))
441
(assert-error (lambda ()
442
(uim '(ustr-nth ustra-fl 5))))
443
(assert-error (lambda ()
444
(uim '(ustr-nth ustra-fl -1))))
447
(uim '(ustr-nth ustra-f 0)))
449
(uim '(ustr-nth ustra-f 1)))
451
(uim '(ustr-nth ustra-f 2)))
453
(uim '(ustr-nth ustra-f 3)))
455
(uim '(ustr-nth ustra-f 4)))
456
(assert-error (lambda ()
457
(uim '(ustr-nth ustra-f 5))))
458
(assert-error (lambda ()
459
(uim '(ustr-nth ustra-f -1))))
462
(uim '(ustr-nth ustra-l 0)))
464
(uim '(ustr-nth ustra-l 1)))
466
(uim '(ustr-nth ustra-l 2)))
468
(uim '(ustr-nth ustra-l 3)))
470
(uim '(ustr-nth ustra-l 4)))
471
(assert-error (lambda ()
472
(uim '(ustr-nth ustra-l 5))))
473
(assert-error (lambda ()
474
(uim '(ustr-nth ustra-l -1))))
476
(assert-error (lambda ()
477
(uim '(ustr-nth ustre 0)))))
479
("test ustr-set-nth!"
481
(uim '(ustr-nth ustra-fl 0)))
483
(uim '(ustr-nth ustra-fl 1)))
485
(uim '(ustr-nth ustra-fl 2)))
487
(uim '(ustr-nth ustra-fl 3)))
489
(uim '(ustr-nth ustra-fl 4)))
490
(assert-error (lambda ()
491
(uim '(ustr-nth ustra-fl 5))))
492
(assert-error (lambda ()
493
(uim '(ustr-nth ustra-fl -1))))
496
(uim '(ustr-length ustra-fl)))
498
(uim '(ustr-cursor-pos ustra-fl)))
499
(uim '(ustr-set-nth! ustra-fl 0 "H"))
501
(uim '(ustr-nth ustra-fl 0)))
502
(assert-equal '("H" "e" "l")
503
(uim '(ustr-former-seq ustra-fl)))
504
(assert-equal '("l" "o")
505
(uim '(ustr-latter-seq ustra-fl)))
507
(uim '(ustr-length ustra-fl)))
509
(uim '(ustr-cursor-pos ustra-fl)))
512
(uim '(ustr-length ustra-fl)))
514
(uim '(ustr-cursor-pos ustra-fl)))
515
(uim '(ustr-set-nth! ustra-fl 1 "E"))
517
(uim '(ustr-nth ustra-fl 1)))
518
(assert-equal '("H" "E" "l")
519
(uim '(ustr-former-seq ustra-fl)))
520
(assert-equal '("l" "o")
521
(uim '(ustr-latter-seq ustra-fl)))
523
(uim '(ustr-length ustra-fl)))
525
(uim '(ustr-cursor-pos ustra-fl)))
528
(uim '(ustr-length ustra-fl)))
530
(uim '(ustr-cursor-pos ustra-fl)))
531
(uim '(ustr-set-nth! ustra-fl 2 "L"))
533
(uim '(ustr-nth ustra-fl 2)))
534
(assert-equal '("H" "E" "L")
535
(uim '(ustr-former-seq ustra-fl)))
536
(assert-equal '("l" "o")
537
(uim '(ustr-latter-seq ustra-fl)))
539
(uim '(ustr-length ustra-fl)))
541
(uim '(ustr-cursor-pos ustra-fl)))
544
(uim '(ustr-length ustra-fl)))
546
(uim '(ustr-cursor-pos ustra-fl)))
547
(uim '(ustr-set-nth! ustra-fl 3 "|"))
549
(uim '(ustr-nth ustra-fl 3)))
550
(assert-equal '("H" "E" "L")
551
(uim '(ustr-former-seq ustra-fl)))
552
(assert-equal '("|" "o")
553
(uim '(ustr-latter-seq ustra-fl)))
555
(uim '(ustr-length ustra-fl)))
557
(uim '(ustr-cursor-pos ustra-fl)))
560
(uim '(ustr-length ustra-fl)))
562
(uim '(ustr-cursor-pos ustra-fl)))
563
(uim '(ustr-set-nth! ustra-fl 4 "O"))
565
(uim '(ustr-nth ustra-fl 4)))
566
(assert-equal '("H" "E" "L")
567
(uim '(ustr-former-seq ustra-fl)))
568
(assert-equal '("|" "O")
569
(uim '(ustr-latter-seq ustra-fl)))
571
(uim '(ustr-length ustra-fl)))
573
(uim '(ustr-cursor-pos ustra-fl)))
576
(uim '(ustr-length ustra-fl)))
578
(uim '(ustr-cursor-pos ustra-fl)))
579
(assert-error (lambda ()
580
(uim '(ustr-set-nth! ustra-fl 5 "5"))))
581
(assert-error (lambda ()
582
(uim '(ustr-nth ustra-fl 5))))
583
(assert-equal '("H" "E" "L")
584
(uim '(ustr-former-seq ustra-fl)))
585
(assert-equal '("|" "O")
586
(uim '(ustr-latter-seq ustra-fl)))
588
(uim '(ustr-length ustra-fl)))
590
(uim '(ustr-cursor-pos ustra-fl)))
591
;; position 5 in former-str
592
(assert-equal '("h" "e" "l" "l" "o")
593
(uim '(ustr-former-seq ustra-f)))
595
(uim '(ustr-latter-seq ustra-f)))
597
(uim '(ustr-length ustra-f)))
599
(uim '(ustr-cursor-pos ustra-f)))
600
(assert-error (lambda ()
601
(uim '(ustr-set-nth! ustra-f 5 "5"))))
602
(assert-error (lambda ()
603
(uim '(ustr-nth ustra-f 5))))
604
(assert-equal '("h" "e" "l" "l" "o")
605
(uim '(ustr-former-seq ustra-f)))
607
(uim '(ustr-latter-seq ustra-f)))
609
(uim '(ustr-length ustra-f)))
611
(uim '(ustr-cursor-pos ustra-f)))
612
;; position 4 in former-str
613
(assert-equal '("h" "e" "l" "l" "o")
614
(uim '(ustr-former-seq ustra-f)))
616
(uim '(ustr-latter-seq ustra-f)))
618
(uim '(ustr-length ustra-f)))
620
(uim '(ustr-cursor-pos ustra-f)))
621
(uim '(ustr-set-nth! ustra-f 4 "O"))
623
(uim '(ustr-nth ustra-f 4)))
624
(assert-equal '("h" "e" "l" "l" "O")
625
(uim '(ustr-former-seq ustra-f)))
627
(uim '(ustr-latter-seq ustra-f)))
629
(uim '(ustr-length ustra-f)))
631
(uim '(ustr-cursor-pos ustra-f)))
632
;; position 0 in latter-str
634
(uim '(ustr-former-seq ustra-l)))
635
(assert-equal '("h" "e" "l" "l" "o")
636
(uim '(ustr-latter-seq ustra-l)))
638
(uim '(ustr-length ustra-l)))
640
(uim '(ustr-cursor-pos ustra-l)))
641
(uim '(ustr-set-nth! ustra-l 0 "H"))
643
(uim '(ustr-nth ustra-l 0)))
645
(uim '(ustr-former-seq ustra-l)))
646
(assert-equal '("H" "e" "l" "l" "o")
647
(uim '(ustr-latter-seq ustra-l)))
649
(uim '(ustr-length ustra-l)))
651
(uim '(ustr-cursor-pos ustra-l))))
654
(assert-true (uim-bool '(eq? (ustr-ref ustra-fl 0)
655
(nthcdr 2 (ustr-former ustra-fl)))))
656
(assert-true (uim-bool '(eq? (ustr-ref ustra-fl 1)
657
(nthcdr 1 (ustr-former ustra-fl)))))
658
(assert-true (uim-bool '(eq? (ustr-ref ustra-fl 2)
659
(nthcdr 0 (ustr-former ustra-fl)))))
660
(assert-true (uim-bool '(eq? (ustr-ref ustra-fl 3)
661
(nthcdr 0 (ustr-latter ustra-fl)))))
662
(assert-true (uim-bool '(eq? (ustr-ref ustra-fl 4)
663
(nthcdr 1 (ustr-latter ustra-fl)))))
664
(assert-error (lambda ()
665
(uim '(ustr-ref ustra-fl 5))))
666
(assert-error (lambda ()
667
(uim '(ustr-ref ustra-fl -1))))
669
(assert-true (uim-bool '(eq? (ustr-ref ustra-f 4)
670
(nthcdr 0 (ustr-former ustra-f)))))
671
(assert-error (lambda ()
672
(uim '(ustr-ref ustra-f 5))))
674
(assert-true (uim-bool '(eq? (ustr-ref ustra-l 0)
675
(nthcdr 0 (ustr-latter ustra-l))))))
679
(assert-equal '("ん" "ン" "ン")
680
(uim '(ustr-cursor-backside ustrj-fl)))
682
(uim '(ustr-length ustrj-fl)))
684
(uim '(ustr-cursor-pos ustrj-fl)))
685
(uim '(ustr-append! ustrj-fl '(("んー" "ンー" "ンー") ("か" "カ" "カ")
687
(assert-equal '("ん" "ン" "ン")
688
(uim '(ustr-cursor-backside ustrj-fl)))
690
(uim '(ustr-length ustrj-fl)))
692
(uim '(ustr-cursor-pos ustrj-fl)))
693
(assert-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
694
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ")
695
("んー" "ンー" "ンー") ("か" "カ" "カ") ("よ" "ヨ" "ヨ"))
696
(uim '(ustr-whole-seq ustrj-fl)))
698
(assert-equal '("じゃ" "ジャ" "ジャ")
699
(uim '(ustr-cursor-backside ustrj-f)))
701
(uim '(ustr-length ustrj-f)))
703
(uim '(ustr-cursor-pos ustrj-f)))
704
(uim '(ustr-append! ustrj-f '(("んー" "ンー" "ンー") ("か" "カ" "カ")
706
(assert-equal '("じゃ" "ジャ" "ジャ")
707
(uim '(ustr-cursor-backside ustrj-f)))
709
(uim '(ustr-length ustrj-f)))
711
(uim '(ustr-cursor-pos ustrj-f)))
712
(assert-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
713
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ")
714
("んー" "ンー" "ンー") ("か" "カ" "カ") ("よ" "ヨ" "ヨ"))
715
(uim '(ustr-whole-seq ustrj-f)))
717
(assert-error (lambda ()
718
(uim '(ustr-cursor-backside ustrj-l))))
720
(uim '(ustr-length ustrj-l)))
722
(uim '(ustr-cursor-pos ustrj-l)))
723
(uim '(ustr-append! ustrj-l '(("んー" "ンー" "ンー") ("か" "カ" "カ")
725
(assert-error (lambda ()
726
(uim '(ustr-cursor-backside ustrj-l))))
728
(uim '(ustr-length ustrj-l)))
730
(uim '(ustr-cursor-pos ustrj-l)))
731
(assert-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
732
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ")
733
("んー" "ンー" "ンー") ("か" "カ" "カ") ("よ" "ヨ" "ヨ"))
734
(uim '(ustr-whole-seq ustrj-l)))
736
(assert-error (lambda ()
737
(uim '(ustr-cursor-backside ustre))))
739
(uim '(ustr-length ustre)))
741
(uim '(ustr-cursor-pos ustre)))
742
(uim '(ustr-append! ustre '(("んー" "ンー" "ンー") ("か" "カ" "カ")
744
(assert-error (lambda ()
745
(uim '(ustr-cursor-backside ustre))))
747
(uim '(ustr-length ustre)))
749
(uim '(ustr-cursor-pos ustre)))
750
(assert-equal '(("んー" "ンー" "ンー") ("か" "カ" "カ") ("よ" "ヨ" "ヨ"))
751
(uim '(ustr-whole-seq ustre))))
753
("test ustr-append! #2"
755
(assert-equal '("ん" "ン" "ン")
756
(uim '(ustr-cursor-backside ustrj-fl)))
758
(uim '(ustr-length ustrj-fl)))
760
(uim '(ustr-cursor-pos ustrj-fl)))
761
(uim '(ustr-append! ustrj-fl ()))
762
(assert-equal '("ん" "ン" "ン")
763
(uim '(ustr-cursor-backside ustrj-fl)))
765
(uim '(ustr-length ustrj-fl)))
767
(uim '(ustr-cursor-pos ustrj-fl)))
768
(assert-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
769
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
770
(uim '(ustr-whole-seq ustrj-fl)))
772
(assert-equal '("じゃ" "ジャ" "ジャ")
773
(uim '(ustr-cursor-backside ustrj-f)))
775
(uim '(ustr-length ustrj-f)))
777
(uim '(ustr-cursor-pos ustrj-f)))
778
(uim '(ustr-append! ustrj-f ()))
779
(assert-equal '("じゃ" "ジャ" "ジャ")
780
(uim '(ustr-cursor-backside ustrj-f)))
782
(uim '(ustr-length ustrj-f)))
784
(uim '(ustr-cursor-pos ustrj-f)))
785
(assert-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
786
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
787
(uim '(ustr-whole-seq ustrj-f)))
789
(assert-error (lambda ()
790
(uim '(ustr-cursor-backside ustrj-l))))
792
(uim '(ustr-length ustrj-l)))
794
(uim '(ustr-cursor-pos ustrj-l)))
795
(uim '(ustr-append! ustrj-l ()))
796
(assert-error (lambda ()
797
(uim '(ustr-cursor-backside ustrj-l))))
799
(uim '(ustr-length ustrj-l)))
801
(uim '(ustr-cursor-pos ustrj-l)))
802
(assert-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
803
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
804
(uim '(ustr-whole-seq ustrj-l)))
806
(assert-error (lambda ()
807
(uim '(ustr-cursor-backside ustre))))
809
(uim '(ustr-length ustre)))
811
(uim '(ustr-cursor-pos ustre)))
812
(uim '(ustr-append! ustre ()))
813
(assert-error (lambda ()
814
(uim '(ustr-cursor-backside ustre))))
816
(uim '(ustr-length ustre)))
818
(uim '(ustr-cursor-pos ustre))))
820
("test ustr-prepend!"
822
(assert-equal '("ん" "ン" "ン")
823
(uim '(ustr-cursor-backside ustrj-fl)))
825
(uim '(ustr-length ustrj-fl)))
827
(uim '(ustr-cursor-pos ustrj-fl)))
828
(uim '(ustr-prepend! ustrj-fl '(("んー" "ンー" "ンー") ("か" "カ" "カ")
830
(assert-equal '("ん" "ン" "ン")
831
(uim '(ustr-cursor-backside ustrj-fl)))
833
(uim '(ustr-length ustrj-fl)))
835
(uim '(ustr-cursor-pos ustrj-fl)))
836
(assert-equal '(("んー" "ンー" "ンー") ("か" "カ" "カ") ("よ" "ヨ" "ヨ")
837
("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
838
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
839
(uim '(ustr-whole-seq ustrj-fl)))
841
(assert-equal '("じゃ" "ジャ" "ジャ")
842
(uim '(ustr-cursor-backside ustrj-f)))
844
(uim '(ustr-length ustrj-f)))
846
(uim '(ustr-cursor-pos ustrj-f)))
847
(uim '(ustr-prepend! ustrj-f '(("んー" "ンー" "ンー") ("か" "カ" "カ")
849
(assert-equal '("じゃ" "ジャ" "ジャ")
850
(uim '(ustr-cursor-backside ustrj-f)))
852
(uim '(ustr-length ustrj-f)))
854
(uim '(ustr-cursor-pos ustrj-f)))
855
(assert-equal '(("んー" "ンー" "ンー") ("か" "カ" "カ") ("よ" "ヨ" "ヨ")
856
("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
857
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
858
(uim '(ustr-whole-seq ustrj-f)))
860
(assert-error (lambda ()
861
(uim '(ustr-cursor-backside ustrj-l))))
863
(uim '(ustr-length ustrj-l)))
865
(uim '(ustr-cursor-pos ustrj-l)))
866
(uim '(ustr-prepend! ustrj-l '(("んー" "ンー" "ンー") ("か" "カ" "カ")
868
(assert-equal '("よ" "ヨ" "ヨ")
869
(uim '(ustr-cursor-backside ustrj-l)))
871
(uim '(ustr-length ustrj-l)))
873
(uim '(ustr-cursor-pos ustrj-l)))
874
(assert-equal '(("んー" "ンー" "ンー") ("か" "カ" "カ") ("よ" "ヨ" "ヨ")
875
("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
876
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
877
(uim '(ustr-whole-seq ustrj-l)))
879
(assert-error (lambda ()
880
(uim '(ustr-cursor-backside ustre))))
882
(uim '(ustr-length ustre)))
884
(uim '(ustr-cursor-pos ustre)))
885
(uim '(ustr-prepend! ustre '(("んー" "ンー" "ンー") ("か" "カ" "カ")
887
(assert-equal '("よ" "ヨ" "ヨ")
888
(uim '(ustr-cursor-backside ustre)))
890
(uim '(ustr-length ustre)))
892
(uim '(ustr-cursor-pos ustre)))
893
(assert-equal '(("んー" "ンー" "ンー") ("か" "カ" "カ") ("よ" "ヨ" "ヨ"))
894
(uim '(ustr-whole-seq ustre))))
896
("test ustr-prepend! #2"
898
(assert-equal '("ん" "ン" "ン")
899
(uim '(ustr-cursor-backside ustrj-fl)))
901
(uim '(ustr-length ustrj-fl)))
903
(uim '(ustr-cursor-pos ustrj-fl)))
904
(uim '(ustr-prepend! ustrj-fl ()))
905
(assert-equal '("ん" "ン" "ン")
906
(uim '(ustr-cursor-backside ustrj-fl)))
908
(uim '(ustr-length ustrj-fl)))
910
(uim '(ustr-cursor-pos ustrj-fl)))
911
(assert-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
912
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
913
(uim '(ustr-whole-seq ustrj-fl)))
915
(assert-equal '("じゃ" "ジャ" "ジャ")
916
(uim '(ustr-cursor-backside ustrj-f)))
918
(uim '(ustr-length ustrj-f)))
920
(uim '(ustr-cursor-pos ustrj-f)))
921
(uim '(ustr-prepend! ustrj-f ()))
922
(assert-equal '("じゃ" "ジャ" "ジャ")
923
(uim '(ustr-cursor-backside ustrj-f)))
925
(uim '(ustr-length ustrj-f)))
927
(uim '(ustr-cursor-pos ustrj-f)))
928
(assert-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
929
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
930
(uim '(ustr-whole-seq ustrj-f)))
932
(assert-error (lambda ()
933
(uim '(ustr-cursor-backside ustrj-l))))
935
(uim '(ustr-length ustrj-l)))
937
(uim '(ustr-cursor-pos ustrj-l)))
938
(uim '(ustr-prepend! ustrj-l ()))
939
(assert-error (lambda ()
940
(uim '(ustr-cursor-backside ustrj-l))))
942
(uim '(ustr-length ustrj-l)))
944
(uim '(ustr-cursor-pos ustrj-l)))
945
(assert-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
946
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
947
(uim '(ustr-whole-seq ustrj-l)))
949
(assert-error (lambda ()
950
(uim '(ustr-cursor-backside ustre))))
952
(uim '(ustr-length ustre)))
954
(uim '(ustr-cursor-pos ustre)))
955
(uim '(ustr-prepend! ustre ()))
956
(assert-error (lambda ()
957
(uim '(ustr-cursor-backside ustre))))
959
(uim '(ustr-length ustre)))
961
(uim '(ustr-cursor-pos ustre))))
963
("test map-ustr-whole"
965
(assert-equal '("h" "e" "l" "l" "o")
966
(uim '(map-ustr-whole car ustr-fl)))
967
(assert-equal '("H" "E" "L" "L" "O")
968
(uim '(map-ustr-whole cdr ustr-fl)))
969
(assert-equal '("に" "ほ" "ん" "ご" "じゃ")
970
(uim '(map-ustr-whole ja-kana-hiragana ustrj-fl)))
971
(assert-equal '("ニ" "ホ" "ン" "ゴ" "ジャ")
972
(uim '(map-ustr-whole ja-kana-katakana ustrj-fl)))
973
(assert-equal '("ニ" "ホ" "ン" "ゴ" "ジャ")
974
(uim '(map-ustr-whole ja-kana-hankaku ustrj-fl)))
976
(assert-equal '("h" "e" "l" "l" "o")
977
(uim '(map-ustr-whole car ustr-f)))
978
(assert-equal '("H" "E" "L" "L" "O")
979
(uim '(map-ustr-whole cdr ustr-f)))
980
(assert-equal '("に" "ほ" "ん" "ご" "じゃ")
981
(uim '(map-ustr-whole ja-kana-hiragana ustrj-f)))
982
(assert-equal '("ニ" "ホ" "ン" "ゴ" "ジャ")
983
(uim '(map-ustr-whole ja-kana-katakana ustrj-f)))
984
(assert-equal '("ニ" "ホ" "ン" "ゴ" "ジャ")
985
(uim '(map-ustr-whole ja-kana-hankaku ustrj-f)))
987
(assert-equal '("h" "e" "l" "l" "o")
988
(uim '(map-ustr-whole car ustr-l)))
989
(assert-equal '("H" "E" "L" "L" "O")
990
(uim '(map-ustr-whole cdr ustr-l)))
991
(assert-equal '("に" "ほ" "ん" "ご" "じゃ")
992
(uim '(map-ustr-whole ja-kana-hiragana ustrj-l)))
993
(assert-equal '("ニ" "ホ" "ン" "ゴ" "ジャ")
994
(uim '(map-ustr-whole ja-kana-katakana ustrj-l)))
995
(assert-equal '("ニ" "ホ" "ン" "ゴ" "ジャ")
996
(uim '(map-ustr-whole ja-kana-hankaku ustrj-l)))
999
(uim '(map-ustr-whole cdr ustre))))
1001
("test map-ustr-former"
1003
(assert-equal '("h" "e" "l")
1004
(uim '(map-ustr-former car ustr-fl)))
1005
(assert-equal '("H" "E" "L")
1006
(uim '(map-ustr-former cdr ustr-fl)))
1007
(assert-equal '("に" "ほ" "ん")
1008
(uim '(map-ustr-former ja-kana-hiragana ustrj-fl)))
1009
(assert-equal '("ニ" "ホ" "ン")
1010
(uim '(map-ustr-former ja-kana-katakana ustrj-fl)))
1011
(assert-equal '("ニ" "ホ" "ン")
1012
(uim '(map-ustr-former ja-kana-hankaku ustrj-fl)))
1014
(assert-equal '("h" "e" "l" "l" "o")
1015
(uim '(map-ustr-former car ustr-f)))
1016
(assert-equal '("H" "E" "L" "L" "O")
1017
(uim '(map-ustr-former cdr ustr-f)))
1018
(assert-equal '("に" "ほ" "ん" "ご" "じゃ")
1019
(uim '(map-ustr-former ja-kana-hiragana ustrj-f)))
1020
(assert-equal '("ニ" "ホ" "ン" "ゴ" "ジャ")
1021
(uim '(map-ustr-former ja-kana-katakana ustrj-f)))
1022
(assert-equal '("ニ" "ホ" "ン" "ゴ" "ジャ")
1023
(uim '(map-ustr-former ja-kana-hankaku ustrj-f)))
1026
(uim '(map-ustr-former car ustr-l)))
1028
(uim '(map-ustr-former cdr ustr-l)))
1030
(uim '(map-ustr-former ja-kana-hiragana ustrj-l)))
1032
(uim '(map-ustr-former ja-kana-katakana ustrj-l)))
1034
(uim '(map-ustr-former ja-kana-hankaku ustrj-l)))
1037
(uim '(map-ustr-former cdr ustre))))
1039
("test map-ustr-latter"
1041
(assert-equal '("l" "o")
1042
(uim '(map-ustr-latter car ustr-fl)))
1043
(assert-equal '("L" "O")
1044
(uim '(map-ustr-latter cdr ustr-fl)))
1045
(assert-equal '("ご" "じゃ")
1046
(uim '(map-ustr-latter ja-kana-hiragana ustrj-fl)))
1047
(assert-equal '("ゴ" "ジャ")
1048
(uim '(map-ustr-latter ja-kana-katakana ustrj-fl)))
1049
(assert-equal '("ゴ" "ジャ")
1050
(uim '(map-ustr-latter ja-kana-hankaku ustrj-fl)))
1053
(uim '(map-ustr-latter car ustr-f)))
1055
(uim '(map-ustr-latter cdr ustr-f)))
1057
(uim '(map-ustr-latter ja-kana-hiragana ustrj-f)))
1059
(uim '(map-ustr-latter ja-kana-katakana ustrj-f)))
1061
(uim '(map-ustr-latter ja-kana-hankaku ustrj-f)))
1063
(assert-equal '("h" "e" "l" "l" "o")
1064
(uim '(map-ustr-latter car ustr-l)))
1065
(assert-equal '("H" "E" "L" "L" "O")
1066
(uim '(map-ustr-latter cdr ustr-l)))
1067
(assert-equal '("に" "ほ" "ん" "ご" "じゃ")
1068
(uim '(map-ustr-latter ja-kana-hiragana ustrj-l)))
1069
(assert-equal '("ニ" "ホ" "ン" "ゴ" "ジャ")
1070
(uim '(map-ustr-latter ja-kana-katakana ustrj-l)))
1071
(assert-equal '("ニ" "ホ" "ン" "ゴ" "ジャ")
1072
(uim '(map-ustr-latter ja-kana-hankaku ustrj-l)))
1075
(uim '(map-ustr-latter cdr ustre))))
1077
("test append-map-ustr-whole"
1078
(assert-equal '("ニ" "ニ" "ホ" "ホ" "ン" "ン" "ゴ" "ゴ" "ジャ" "ジャ")
1079
(uim '(append-map-ustr-whole cdr ustrj-fl)))
1080
(assert-equal '("ニ" "ニ" "ホ" "ホ" "ン" "ン" "ゴ" "ゴ" "ジャ" "ジャ")
1081
(uim '(append-map-ustr-whole cdr ustrj-f)))
1082
(assert-equal '("ニ" "ニ" "ホ" "ホ" "ン" "ン" "ゴ" "ゴ" "ジャ" "ジャ")
1083
(uim '(append-map-ustr-whole cdr ustrj-l)))
1085
(uim '(append-map-ustr-whole cdr ustre))))
1087
("test append-map-ustr-former"
1088
(assert-equal '("ニ" "ニ" "ホ" "ホ" "ン" "ン")
1089
(uim '(append-map-ustr-former cdr ustrj-fl)))
1090
(assert-equal '("ニ" "ニ" "ホ" "ホ" "ン" "ン" "ゴ" "ゴ" "ジャ" "ジャ")
1091
(uim '(append-map-ustr-former cdr ustrj-f)))
1093
(uim '(append-map-ustr-former cdr ustrj-l)))
1095
(uim '(append-map-ustr-former cdr ustre))))
1097
("test append-map-ustr-latter"
1098
(assert-equal '("ゴ" "ゴ" "ジャ" "ジャ")
1099
(uim '(append-map-ustr-latter cdr ustrj-fl)))
1101
(uim '(append-map-ustr-latter cdr ustrj-f)))
1102
(assert-equal '("ニ" "ニ" "ホ" "ホ" "ン" "ン" "ゴ" "ゴ" "ジャ" "ジャ")
1103
(uim '(append-map-ustr-latter cdr ustrj-l)))
1105
(uim '(append-map-ustr-latter cdr ustre))))
1107
("test string-append-map-ustr-whole"
1109
(assert-equal "hello"
1110
(uim '(string-append-map-ustr-whole car ustr-fl)))
1111
(assert-equal "HELLO"
1112
(uim '(string-append-map-ustr-whole cdr ustr-fl)))
1113
(assert-equal "にほんごじゃ"
1114
(uim '(string-append-map-ustr-whole ja-kana-hiragana
1116
(assert-equal "ニホンゴジャ"
1117
(uim '(string-append-map-ustr-whole ja-kana-katakana
1119
(assert-equal "ニホンゴジャ"
1120
(uim '(string-append-map-ustr-whole ja-kana-hankaku
1123
(assert-equal "hello"
1124
(uim '(string-append-map-ustr-whole car ustr-f)))
1125
(assert-equal "HELLO"
1126
(uim '(string-append-map-ustr-whole cdr ustr-f)))
1127
(assert-equal "にほんごじゃ"
1128
(uim '(string-append-map-ustr-whole ja-kana-hiragana
1130
(assert-equal "ニホンゴジャ"
1131
(uim '(string-append-map-ustr-whole ja-kana-katakana
1133
(assert-equal "ニホンゴジャ"
1134
(uim '(string-append-map-ustr-whole ja-kana-hankaku
1137
(assert-equal "hello"
1138
(uim '(string-append-map-ustr-whole car ustr-l)))
1139
(assert-equal "HELLO"
1140
(uim '(string-append-map-ustr-whole cdr ustr-l)))
1141
(assert-equal "にほんごじゃ"
1142
(uim '(string-append-map-ustr-whole ja-kana-hiragana
1144
(assert-equal "ニホンゴジャ"
1145
(uim '(string-append-map-ustr-whole ja-kana-katakana
1147
(assert-equal "ニホンゴジャ"
1148
(uim '(string-append-map-ustr-whole ja-kana-hankaku
1152
(uim '(string-append-map-ustr-whole cdr ustre))))
1154
("test string-append-map-ustr-former"
1157
(uim '(string-append-map-ustr-former car ustr-fl)))
1159
(uim '(string-append-map-ustr-former cdr ustr-fl)))
1161
(uim '(string-append-map-ustr-former ja-kana-hiragana
1164
(uim '(string-append-map-ustr-former ja-kana-katakana
1167
(uim '(string-append-map-ustr-former ja-kana-hankaku
1170
(assert-equal "hello"
1171
(uim '(string-append-map-ustr-former car ustr-f)))
1172
(assert-equal "HELLO"
1173
(uim '(string-append-map-ustr-former cdr ustr-f)))
1174
(assert-equal "にほんごじゃ"
1175
(uim '(string-append-map-ustr-former ja-kana-hiragana
1177
(assert-equal "ニホンゴジャ"
1178
(uim '(string-append-map-ustr-former ja-kana-katakana
1180
(assert-equal "ニホンゴジャ"
1181
(uim '(string-append-map-ustr-former ja-kana-hankaku
1185
(uim '(string-append-map-ustr-former car ustr-l)))
1187
(uim '(string-append-map-ustr-former cdr ustr-l)))
1189
(uim '(string-append-map-ustr-former ja-kana-hiragana
1192
(uim '(string-append-map-ustr-former ja-kana-katakana
1195
(uim '(string-append-map-ustr-former ja-kana-hankaku
1199
(uim '(string-append-map-ustr-former cdr ustre))))
1201
("test string-append-map-ustr-latter"
1204
(uim '(string-append-map-ustr-latter car ustr-fl)))
1206
(uim '(string-append-map-ustr-latter cdr ustr-fl)))
1208
(uim '(string-append-map-ustr-latter ja-kana-hiragana
1211
(uim '(string-append-map-ustr-latter ja-kana-katakana
1213
(assert-equal "ゴジャ"
1214
(uim '(string-append-map-ustr-latter ja-kana-hankaku
1218
(uim '(string-append-map-ustr-latter car ustr-f)))
1220
(uim '(string-append-map-ustr-latter cdr ustr-f)))
1222
(uim '(string-append-map-ustr-latter ja-kana-hiragana
1225
(uim '(string-append-map-ustr-latter ja-kana-katakana
1228
(uim '(string-append-map-ustr-latter ja-kana-hankaku
1231
(assert-equal "hello"
1232
(uim '(string-append-map-ustr-latter car ustr-l)))
1233
(assert-equal "HELLO"
1234
(uim '(string-append-map-ustr-latter cdr ustr-l)))
1235
(assert-equal "にほんごじゃ"
1236
(uim '(string-append-map-ustr-latter ja-kana-hiragana
1238
(assert-equal "ニホンゴジャ"
1239
(uim '(string-append-map-ustr-latter ja-kana-katakana
1241
(assert-equal "ニホンゴジャ"
1242
(uim '(string-append-map-ustr-latter ja-kana-hankaku
1246
(uim '(string-append-map-ustr-latter cdr ustre))))
1248
("test ustr-cursor-at-beginning?"
1249
(assert-false (uim-bool '(ustr-cursor-at-beginning? ustra-fl)))
1250
(assert-false (uim-bool '(ustr-cursor-at-beginning? ustra-f)))
1251
(assert-true (uim-bool '(ustr-cursor-at-beginning? ustra-l)))
1252
(assert-true (uim-bool '(ustr-cursor-at-beginning? ustre))))
1254
("test ustr-cursor-at-end?"
1255
(assert-false (uim-bool '(ustr-cursor-at-end? ustra-fl)))
1256
(assert-true (uim-bool '(ustr-cursor-at-end? ustra-f)))
1257
(assert-false (uim-bool '(ustr-cursor-at-end? ustra-l)))
1258
(assert-true (uim-bool '(ustr-cursor-at-end? ustre))))
1260
("test ustr-cursor-pos"
1262
(uim '(ustr-cursor-pos ustr-fl)))
1264
(uim '(ustr-cursor-pos ustr-f)))
1266
(uim '(ustr-cursor-pos ustr-l)))
1269
(uim '(ustr-cursor-pos ustrj-fl)))
1271
(uim '(ustr-cursor-pos ustrj-f)))
1273
(uim '(ustr-cursor-pos ustrj-l)))
1276
(uim '(ustr-cursor-pos ustra-fl)))
1278
(uim '(ustr-cursor-pos ustra-f)))
1280
(uim '(ustr-cursor-pos ustra-l)))
1283
(uim '(ustr-cursor-pos ustre))))
1285
("test ustr-set-cursor-pos!"
1288
(uim '(ustr-cursor-pos ustra-fl)))
1289
(assert-true (uim-bool '(ustr-set-cursor-pos! ustra-fl 0)))
1291
(uim '(ustr-cursor-pos ustra-fl)))
1292
(assert-true (uim-bool '(ustr-set-cursor-pos! ustra-fl 5)))
1294
(uim '(ustr-cursor-pos ustra-fl)))
1295
(assert-true (uim-bool '(ustr-set-cursor-pos! ustra-fl 2)))
1297
(uim '(ustr-cursor-pos ustra-fl)))
1298
(assert-false (uim-bool '(ustr-set-cursor-pos! ustra-fl -1)))
1299
(assert-false (uim-bool '(ustr-set-cursor-pos! ustra-fl 6)))
1302
(uim '(ustr-cursor-pos ustre)))
1303
(assert-true (uim-bool '(ustr-set-cursor-pos! ustra-fl 0)))
1305
(uim '(ustr-cursor-pos ustre)))
1306
(assert-false (uim-bool '(ustr-set-cursor-pos! ustre -1)))
1307
(assert-false (uim-bool '(ustr-set-cursor-pos! ustre 1))))
1309
("test ustr-cursor-move!"
1311
(uim '(ustr-cursor-pos ustra-fl)))
1312
(assert-false (uim-bool '(ustr-cursor-move! ustra-fl -4)))
1314
(uim '(ustr-cursor-pos ustra-fl)))
1316
(assert-false (uim-bool '(ustr-cursor-move! ustra-fl 3)))
1318
(uim '(ustr-cursor-pos ustra-fl)))
1320
(assert-true (uim-bool '(ustr-cursor-move! ustra-fl 2)))
1322
(uim '(ustr-cursor-pos ustra-fl)))
1324
(assert-true (uim-bool '(ustr-cursor-move! ustra-fl -3)))
1326
(uim '(ustr-cursor-pos ustra-fl)))
1328
(assert-true (uim-bool '(ustr-cursor-move! ustra-fl 1)))
1330
(uim '(ustr-cursor-pos ustra-fl)))
1332
(assert-true (uim-bool '(ustr-cursor-move! ustra-fl 0)))
1334
(uim '(ustr-cursor-pos ustra-fl)))
1336
(assert-true (uim-bool '(ustr-cursor-move! ustra-fl -3)))
1338
(uim '(ustr-cursor-pos ustra-fl)))
1341
(uim '(ustr-cursor-pos ustre)))
1342
(assert-true (uim-bool '(ustr-cursor-move! ustra-fl 0)))
1344
(uim '(ustr-cursor-pos ustre)))
1346
(assert-false (uim-bool '(ustr-cursor-move! ustre -1)))
1347
(assert-false (uim-bool '(ustr-cursor-move! ustre 1))))
1349
("test ustr-cursor-move-backward!"
1351
(uim '(ustr-cursor-pos ustra-fl)))
1353
(uim '(ustr-cursor-move-backward! ustra-fl))
1355
(uim '(ustr-cursor-pos ustra-fl)))
1357
(uim '(ustr-cursor-move-backward! ustra-fl))
1359
(uim '(ustr-cursor-pos ustra-fl)))
1361
(uim '(ustr-cursor-move-backward! ustra-fl))
1363
(uim '(ustr-cursor-pos ustra-fl)))
1365
(uim '(ustr-cursor-move-backward! ustra-fl))
1367
(uim '(ustr-cursor-pos ustra-fl)))
1368
;; start from end of string
1370
(uim '(ustr-cursor-pos ustra-f)))
1371
(uim '(ustr-cursor-move-backward! ustra-f))
1373
(uim '(ustr-cursor-pos ustra-f))))
1375
("test ustr-cursor-move-forward!"
1377
(uim '(ustr-cursor-pos ustra-fl)))
1379
(uim '(ustr-cursor-move-forward! ustra-fl))
1381
(uim '(ustr-cursor-pos ustra-fl)))
1383
(uim '(ustr-cursor-move-forward! ustra-fl))
1385
(uim '(ustr-cursor-pos ustra-fl)))
1387
(uim '(ustr-cursor-move-forward! ustra-fl))
1389
(uim '(ustr-cursor-pos ustra-fl)))
1391
;; start from beginning of string
1393
(uim '(ustr-cursor-pos ustra-l)))
1394
(uim '(ustr-cursor-move-forward! ustra-l))
1396
(uim '(ustr-cursor-pos ustra-l))))
1398
("test ustr-cursor-move-beginning!"
1400
(uim '(ustr-cursor-pos ustra-fl)))
1402
(uim '(ustr-cursor-move-beginning! ustra-fl))
1404
(uim '(ustr-cursor-pos ustra-fl)))
1406
(uim '(ustr-cursor-move-beginning! ustra-fl))
1408
(uim '(ustr-cursor-pos ustra-fl)))
1410
;; start from end of string
1412
(uim '(ustr-cursor-pos ustra-f)))
1413
(uim '(ustr-cursor-move-beginning! ustra-f))
1415
(uim '(ustr-cursor-pos ustra-f))))
1417
("test ustr-cursor-move-end!"
1419
(uim '(ustr-cursor-pos ustra-fl)))
1421
(uim '(ustr-cursor-move-end! ustra-fl))
1423
(uim '(ustr-cursor-pos ustra-fl)))
1425
(uim '(ustr-cursor-move-end! ustra-fl))
1427
(uim '(ustr-cursor-pos ustra-fl)))
1429
;; start from beginning of string
1431
(uim '(ustr-cursor-pos ustra-l)))
1432
(uim '(ustr-cursor-move-end! ustra-l))
1434
(uim '(ustr-cursor-pos ustra-l))))
1436
("test ustr-cursor-frontside"
1438
(assert-equal '("l" . "L")
1439
(uim '(ustr-cursor-frontside ustr-fl)))
1440
(assert-equal '("ご" "ゴ" "ゴ")
1441
(uim '(ustr-cursor-frontside ustrj-fl)))
1443
(uim '(ustr-cursor-frontside ustra-fl)))
1445
(assert-error (lambda ()
1446
(uim '(ustr-cursor-frontside ustr-f))))
1447
(assert-error (lambda ()
1448
(uim '(ustr-cursor-frontside ustrj-f))))
1449
(assert-error (lambda ()
1450
(uim '(ustr-cursor-frontside ustra-f))))
1452
(assert-equal '("h" . "H")
1453
(uim '(ustr-cursor-frontside ustr-l)))
1454
(assert-equal '("に" "ニ" "ニ")
1455
(uim '(ustr-cursor-frontside ustrj-l)))
1457
(uim '(ustr-cursor-frontside ustra-l)))
1459
(assert-error (lambda ()
1460
(uim '(ustr-cursor-frontside ustre)))))
1462
("test ustr-cursor-backside"
1464
(assert-equal '("l" . "L")
1465
(uim '(ustr-cursor-backside ustr-fl)))
1466
(assert-equal '("ん" "ン" "ン")
1467
(uim '(ustr-cursor-backside ustrj-fl)))
1469
(uim '(ustr-cursor-backside ustra-fl)))
1471
(assert-equal '("o" . "O")
1472
(uim '(ustr-cursor-backside ustr-f)))
1473
(assert-equal '("じゃ" "ジャ" "ジャ")
1474
(uim '(ustr-cursor-backside ustrj-f)))
1476
(uim '(ustr-cursor-backside ustra-f)))
1478
(assert-error (lambda ()
1479
(uim '(ustr-cursor-backside ustr-l))))
1480
(assert-error (lambda ()
1481
(uim '(ustr-cursor-backside ustrj-l))))
1482
(assert-error (lambda ()
1483
(uim '(ustr-cursor-backside ustra-l))))
1485
(assert-error (lambda ()
1486
(uim '(ustr-cursor-backside ustre)))))
1488
("test ustr-cursor-delete-frontside!"
1490
(assert-equal '("ご" "ゴ" "ゴ")
1491
(uim '(ustr-cursor-frontside ustrj-fl)))
1493
(uim '(ustr-length ustrj-fl)))
1495
(uim '(ustr-cursor-pos ustrj-fl)))
1496
(assert-true (uim-bool '(ustr-cursor-delete-frontside! ustrj-fl)))
1497
(assert-equal '("じゃ" "ジャ" "ジャ")
1498
(uim '(ustr-cursor-frontside ustrj-fl)))
1500
(uim '(ustr-length ustrj-fl)))
1502
(uim '(ustr-cursor-pos ustrj-fl)))
1503
(assert-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
1505
(uim '(ustr-whole-seq ustrj-fl)))
1507
(assert-error (lambda ()
1508
(uim '(ustr-cursor-frontside ustrj-f))))
1510
(uim '(ustr-length ustrj-f)))
1512
(uim '(ustr-cursor-pos ustrj-f)))
1513
(assert-false (uim-bool '(ustr-cursor-delete-frontside! ustrj-f)))
1514
(assert-error (lambda ()
1515
(uim '(ustr-cursor-frontside ustrj-f))))
1517
(uim '(ustr-length ustrj-f)))
1519
(uim '(ustr-cursor-pos ustrj-f)))
1520
(assert-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
1521
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
1522
(uim '(ustr-whole-seq ustrj-f)))
1524
(assert-equal '("に" "ニ" "ニ")
1525
(uim '(ustr-cursor-frontside ustrj-l)))
1527
(uim '(ustr-length ustrj-l)))
1529
(uim '(ustr-cursor-pos ustrj-l)))
1530
(assert-true (uim-bool '(ustr-cursor-delete-frontside! ustrj-l)))
1531
(assert-equal '("ほ" "ホ" "ホ")
1532
(uim '(ustr-cursor-frontside ustrj-l)))
1534
(uim '(ustr-length ustrj-l)))
1536
(uim '(ustr-cursor-pos ustrj-l)))
1537
(assert-equal '(("ほ" "ホ" "ホ") ("ん" "ン" "ン")
1538
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
1539
(uim '(ustr-whole-seq ustrj-l)))
1541
(assert-error (lambda ()
1542
(uim '(ustr-cursor-frontside ustre))))
1544
(uim '(ustr-length ustre)))
1546
(uim '(ustr-cursor-pos ustre)))
1547
(assert-false (uim-bool '(ustr-cursor-delete-frontside! ustre)))
1548
(assert-error (lambda ()
1549
(uim '(ustr-cursor-frontside ustre))))
1551
(uim '(ustr-length ustre)))
1553
(uim '(ustr-cursor-pos ustre))))
1555
("test ustr-cursor-delete-backside!"
1557
(assert-equal '("ん" "ン" "ン")
1558
(uim '(ustr-cursor-backside ustrj-fl)))
1560
(uim '(ustr-length ustrj-fl)))
1562
(uim '(ustr-cursor-pos ustrj-fl)))
1563
(assert-true (uim-bool '(ustr-cursor-delete-backside! ustrj-fl)))
1564
(assert-equal '("ほ" "ホ" "ホ")
1565
(uim '(ustr-cursor-backside ustrj-fl)))
1567
(uim '(ustr-length ustrj-fl)))
1569
(uim '(ustr-cursor-pos ustrj-fl)))
1570
(assert-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ")
1571
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
1572
(uim '(ustr-whole-seq ustrj-fl)))
1574
(assert-equal '("じゃ" "ジャ" "ジャ")
1575
(uim '(ustr-cursor-backside ustrj-f)))
1577
(uim '(ustr-length ustrj-f)))
1579
(uim '(ustr-cursor-pos ustrj-f)))
1580
(assert-true (uim-bool '(ustr-cursor-delete-backside! ustrj-f)))
1581
(assert-equal '("ご" "ゴ" "ゴ")
1582
(uim '(ustr-cursor-backside ustrj-f)))
1584
(uim '(ustr-length ustrj-f)))
1586
(uim '(ustr-cursor-pos ustrj-f)))
1587
(assert-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
1589
(uim '(ustr-whole-seq ustrj-f)))
1591
(assert-error (lambda ()
1592
(uim '(ustr-cursor-backside ustrj-l))))
1594
(uim '(ustr-length ustrj-l)))
1596
(uim '(ustr-cursor-pos ustrj-l)))
1597
(assert-false (uim-bool '(ustr-cursor-delete-backside! ustrj-l)))
1598
(assert-error (lambda ()
1599
(uim '(ustr-cursor-backside ustrj-l))))
1601
(uim '(ustr-length ustrj-l)))
1603
(uim '(ustr-cursor-pos ustrj-l)))
1604
(assert-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
1605
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
1606
(uim '(ustr-whole-seq ustrj-l)))
1608
(assert-error (lambda ()
1609
(uim '(ustr-cursor-backside ustre))))
1611
(uim '(ustr-length ustre)))
1612
(assert-false (uim-bool '(ustr-cursor-delete-backside! ustre)))
1613
(assert-error (lambda ()
1614
(uim '(ustr-cursor-backside ustre))))
1616
(uim '(ustr-length ustre))))
1618
("test ustr-insert-elem!"
1620
(assert-equal '("ん" "ン" "ン")
1621
(uim '(ustr-cursor-backside ustrj-fl)))
1623
(uim '(ustr-length ustrj-fl)))
1625
(uim '(ustr-cursor-pos ustrj-fl)))
1626
(uim '(ustr-insert-elem! ustrj-fl '("んー" "ンー" "ンー")))
1627
(assert-equal '("んー" "ンー" "ンー")
1628
(uim '(ustr-cursor-backside ustrj-fl)))
1630
(uim '(ustr-length ustrj-fl)))
1632
(uim '(ustr-cursor-pos ustrj-fl)))
1633
(assert-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
1635
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
1636
(uim '(ustr-whole-seq ustrj-fl)))
1638
(assert-equal '("じゃ" "ジャ" "ジャ")
1639
(uim '(ustr-cursor-backside ustrj-f)))
1641
(uim '(ustr-length ustrj-f)))
1643
(uim '(ustr-cursor-pos ustrj-f)))
1644
(uim '(ustr-insert-elem! ustrj-f '("んー" "ンー" "ンー")))
1645
(assert-equal '("んー" "ンー" "ンー")
1646
(uim '(ustr-cursor-backside ustrj-f)))
1648
(uim '(ustr-length ustrj-f)))
1650
(uim '(ustr-cursor-pos ustrj-f)))
1651
(assert-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
1652
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ") ("んー" "ンー" "ンー"))
1653
(uim '(ustr-whole-seq ustrj-f)))
1655
(assert-error (lambda ()
1656
(uim '(ustr-cursor-backside ustrj-l))))
1658
(uim '(ustr-length ustrj-l)))
1660
(uim '(ustr-cursor-pos ustrj-l)))
1661
(uim '(ustr-insert-elem! ustrj-l '("んー" "ンー" "ンー")))
1662
(assert-equal '("んー" "ンー" "ンー")
1663
(uim '(ustr-cursor-backside ustrj-l)))
1665
(uim '(ustr-length ustrj-l)))
1667
(uim '(ustr-cursor-pos ustrj-l)))
1668
(assert-equal '(("んー" "ンー" "ンー")
1669
("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
1670
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
1671
(uim '(ustr-whole-seq ustrj-l)))
1673
(assert-error (lambda ()
1674
(uim '(ustr-cursor-backside ustre))))
1676
(uim '(ustr-length ustre)))
1677
(uim '(ustr-insert-elem! ustre '("んー" "ンー" "ンー")))
1678
(assert-equal '("んー" "ンー" "ンー")
1679
(uim '(ustr-cursor-backside ustre)))
1681
(uim '(ustr-length ustre)))
1682
(assert-equal '(("んー" "ンー" "ンー"))
1683
(uim '(ustr-whole-seq ustre))))
1685
("test ustr-cursor-set-frontside!"
1687
(assert-equal '("ご" "ゴ" "ゴ")
1688
(uim '(ustr-cursor-frontside ustrj-fl)))
1690
(uim '(ustr-length ustrj-fl)))
1692
(uim '(ustr-cursor-pos ustrj-fl)))
1693
(assert-true (uim-bool '(ustr-cursor-set-frontside! ustrj-fl
1694
'("んー" "ンー" "ンー"))))
1695
(assert-equal '("んー" "ンー" "ンー")
1696
(uim '(ustr-cursor-frontside ustrj-fl)))
1698
(uim '(ustr-length ustrj-fl)))
1700
(uim '(ustr-cursor-pos ustrj-fl)))
1701
(assert-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
1702
("んー" "ンー" "ンー") ("じゃ" "ジャ" "ジャ"))
1703
(uim '(ustr-whole-seq ustrj-fl)))
1705
(assert-error (lambda ()
1706
(uim '(ustr-cursor-frontside ustrj-f))))
1708
(uim '(ustr-length ustrj-f)))
1710
(uim '(ustr-cursor-pos ustrj-f)))
1711
(assert-false (uim-bool '(ustr-cursor-set-frontside! ustrj-f
1712
'("んー" "ンー" "ンー"))))
1714
(uim '(ustr-length ustrj-f)))
1716
(uim '(ustr-cursor-pos ustrj-f)))
1717
(assert-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
1718
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
1719
(uim '(ustr-whole-seq ustrj-f)))
1721
(assert-equal '("に" "ニ" "ニ")
1722
(uim '(ustr-cursor-frontside ustrj-l)))
1724
(uim '(ustr-length ustrj-l)))
1726
(uim '(ustr-cursor-pos ustrj-l)))
1727
(assert-true (uim-bool '(ustr-cursor-set-frontside! ustrj-l
1728
'("んー" "ンー" "ンー"))))
1729
(assert-equal '("んー" "ンー" "ンー")
1730
(uim '(ustr-cursor-frontside ustrj-l)))
1732
(uim '(ustr-length ustrj-l)))
1734
(uim '(ustr-cursor-pos ustrj-l)))
1735
(assert-equal '(("んー" "ンー" "ンー") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
1736
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
1737
(uim '(ustr-whole-seq ustrj-l)))
1739
(assert-error (lambda ()
1740
(uim '(ustr-cursor-frontside ustre))))
1742
(uim '(ustr-length ustre)))
1743
(assert-false (uim-bool '(ustr-cursor-set-frontside! ustre
1744
'("んー" "ンー" "ンー"))))
1745
(assert-error (lambda ()
1746
(uim '(ustr-cursor-frontside ustre))))
1748
(uim '(ustr-length ustre)))
1750
(uim '(ustr-whole-seq ustre))))
1752
("test ustr-cursor-set-backside!"
1754
(assert-equal '("ん" "ン" "ン")
1755
(uim '(ustr-cursor-backside ustrj-fl)))
1757
(uim '(ustr-length ustrj-fl)))
1759
(uim '(ustr-cursor-pos ustrj-fl)))
1760
(assert-true (uim-bool '(ustr-cursor-set-backside! ustrj-fl
1761
'("んー" "ンー" "ンー"))))
1762
(assert-equal '("んー" "ンー" "ンー")
1763
(uim '(ustr-cursor-backside ustrj-fl)))
1765
(uim '(ustr-length ustrj-fl)))
1767
(uim '(ustr-cursor-pos ustrj-fl)))
1768
(assert-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("んー" "ンー" "ンー")
1769
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
1770
(uim '(ustr-whole-seq ustrj-fl)))
1772
(assert-equal '("じゃ" "ジャ" "ジャ")
1773
(uim '(ustr-cursor-backside ustrj-f)))
1775
(uim '(ustr-length ustrj-f)))
1777
(uim '(ustr-cursor-pos ustrj-f)))
1778
(assert-true (uim-bool '(ustr-cursor-set-backside! ustrj-f
1779
'("んー" "ンー" "ンー"))))
1780
(assert-equal '("んー" "ンー" "ンー")
1781
(uim '(ustr-cursor-backside ustrj-f)))
1783
(uim '(ustr-length ustrj-f)))
1785
(uim '(ustr-cursor-pos ustrj-f)))
1786
(assert-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
1787
("ご" "ゴ" "ゴ") ("んー" "ンー" "ンー"))
1788
(uim '(ustr-whole-seq ustrj-f)))
1790
(assert-error (lambda ()
1791
(uim '(ustr-cursor-backside ustrj-l))))
1793
(uim '(ustr-length ustrj-l)))
1795
(uim '(ustr-cursor-pos ustrj-l)))
1796
(assert-false (uim-bool '(ustr-cursor-set-backside! ustrj-l
1797
'("んー" "ンー" "ンー"))))
1798
(assert-error (lambda ()
1799
(uim '(ustr-cursor-backside ustrj-l))))
1801
(uim '(ustr-length ustrj-l)))
1803
(uim '(ustr-cursor-pos ustrj-l)))
1804
(assert-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
1805
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
1806
(uim '(ustr-whole-seq ustrj-l)))
1808
(assert-error (lambda ()
1809
(uim '(ustr-cursor-backside ustre))))
1811
(uim '(ustr-length ustre)))
1812
(assert-false (uim-bool '(ustr-cursor-set-backside! ustre
1813
'("んー" "ンー" "ンー"))))
1814
(assert-error (lambda ()
1815
(uim '(ustr-cursor-backside ustre))))
1817
(uim '(ustr-length ustre)))
1819
(uim '(ustr-whole-seq ustre))))
1821
("test ustr-insert-seq!"
1823
(assert-equal '("ん" "ン" "ン")
1824
(uim '(ustr-cursor-backside ustrj-fl)))
1826
(uim '(ustr-length ustrj-fl)))
1828
(uim '(ustr-cursor-pos ustrj-fl)))
1829
(uim '(ustr-insert-seq! ustrj-fl '(("んー" "ンー" "ンー") ("か" "カ" "カ")
1831
(assert-equal '("よ" "ヨ" "ヨ")
1832
(uim '(ustr-cursor-backside ustrj-fl)))
1834
(uim '(ustr-length ustrj-fl)))
1836
(uim '(ustr-cursor-pos ustrj-fl)))
1837
(assert-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
1838
("んー" "ンー" "ンー") ("か" "カ" "カ") ("よ" "ヨ" "ヨ")
1839
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
1840
(uim '(ustr-whole-seq ustrj-fl)))
1842
(assert-equal '("じゃ" "ジャ" "ジャ")
1843
(uim '(ustr-cursor-backside ustrj-f)))
1845
(uim '(ustr-length ustrj-f)))
1847
(uim '(ustr-cursor-pos ustrj-f)))
1848
(uim '(ustr-insert-seq! ustrj-f '(("んー" "ンー" "ンー") ("か" "カ" "カ")
1850
(assert-equal '("よ" "ヨ" "ヨ")
1851
(uim '(ustr-cursor-backside ustrj-f)))
1853
(uim '(ustr-length ustrj-f)))
1855
(uim '(ustr-cursor-pos ustrj-f)))
1856
(assert-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
1857
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ")
1858
("んー" "ンー" "ンー") ("か" "カ" "カ") ("よ" "ヨ" "ヨ"))
1859
(uim '(ustr-whole-seq ustrj-f)))
1861
(assert-error (lambda ()
1862
(uim '(ustr-cursor-backside ustrj-l))))
1864
(uim '(ustr-length ustrj-l)))
1866
(uim '(ustr-cursor-pos ustrj-l)))
1867
(uim '(ustr-insert-seq! ustrj-l '(("んー" "ンー" "ンー") ("か" "カ" "カ")
1869
(assert-equal '("よ" "ヨ" "ヨ")
1870
(uim '(ustr-cursor-backside ustrj-l)))
1872
(uim '(ustr-length ustrj-l)))
1874
(uim '(ustr-cursor-pos ustrj-l)))
1875
(assert-equal '(("んー" "ンー" "ンー") ("か" "カ" "カ") ("よ" "ヨ" "ヨ")
1876
("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
1877
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
1878
(uim '(ustr-whole-seq ustrj-l)))
1880
(assert-error (lambda ()
1881
(uim '(ustr-cursor-backside ustre))))
1883
(uim '(ustr-length ustre)))
1885
(uim '(ustr-cursor-pos ustre)))
1886
(uim '(ustr-insert-seq! ustre '(("んー" "ンー" "ンー") ("か" "カ" "カ")
1888
(assert-equal '("よ" "ヨ" "ヨ")
1889
(uim '(ustr-cursor-backside ustre)))
1891
(uim '(ustr-length ustre)))
1893
(uim '(ustr-cursor-pos ustre)))
1894
(assert-equal '(("んー" "ンー" "ンー") ("か" "カ" "カ") ("よ" "ヨ" "ヨ"))
1895
(uim '(ustr-whole-seq ustre))))
1897
("test ustr-insert-seq! #2"
1899
(assert-equal '("ん" "ン" "ン")
1900
(uim '(ustr-cursor-backside ustrj-fl)))
1902
(uim '(ustr-length ustrj-fl)))
1904
(uim '(ustr-cursor-pos ustrj-fl)))
1905
(uim '(ustr-insert-seq! ustrj-fl ()))
1906
(assert-equal '("ん" "ン" "ン")
1907
(uim '(ustr-cursor-backside ustrj-fl)))
1909
(uim '(ustr-length ustrj-fl)))
1911
(uim '(ustr-cursor-pos ustrj-fl)))
1912
(assert-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
1913
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
1914
(uim '(ustr-whole-seq ustrj-fl)))
1916
(assert-equal '("じゃ" "ジャ" "ジャ")
1917
(uim '(ustr-cursor-backside ustrj-f)))
1919
(uim '(ustr-length ustrj-f)))
1921
(uim '(ustr-cursor-pos ustrj-f)))
1922
(uim '(ustr-insert-seq! ustrj-f ()))
1923
(assert-equal '("じゃ" "ジャ" "ジャ")
1924
(uim '(ustr-cursor-backside ustrj-f)))
1926
(uim '(ustr-length ustrj-f)))
1928
(uim '(ustr-cursor-pos ustrj-f)))
1929
(assert-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
1930
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
1931
(uim '(ustr-whole-seq ustrj-f)))
1933
(assert-error (lambda ()
1934
(uim '(ustr-cursor-backside ustrj-l))))
1936
(uim '(ustr-length ustrj-l)))
1938
(uim '(ustr-cursor-pos ustrj-l)))
1939
(uim '(ustr-insert-seq! ustrj-l ()))
1940
(assert-error (lambda ()
1941
(uim '(ustr-cursor-backside ustrj-l))))
1943
(uim '(ustr-length ustrj-l)))
1945
(uim '(ustr-cursor-pos ustrj-l)))
1946
(assert-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
1947
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
1948
(uim '(ustr-whole-seq ustrj-l)))
1950
(assert-error (lambda ()
1951
(uim '(ustr-cursor-backside ustre))))
1953
(uim '(ustr-length ustre)))
1955
(uim '(ustr-cursor-pos ustre)))
1956
(uim '(ustr-insert-seq! ustre ()))
1957
(assert-error (lambda ()
1958
(uim '(ustr-cursor-backside ustre))))
1960
(uim '(ustr-length ustre)))
1962
(uim '(ustr-cursor-pos ustre)))))
30
;; These tests are passed at revision 6600 (new repository)
32
(define-module test.test-ustr
33
(use test.unit.test-case)
35
(select-module test.test-ustr)
39
(uim-eval '(require "ustr.scm"))
40
(uim-eval '(define-record 'ja-kana
46
(define ustr-f (ustr-new '(("h" . "H") ("e" . "E") ("l" . "L")
47
("l" . "L") ("o" . "O"))))
48
(define ustr-fl (ustr-new '(("h" . "H") ("e" . "E") ("l" . "L"))
49
'(("l" . "L") ("o" . "O"))))
50
(define ustr-l (ustr-new ()
51
'(("h" . "H") ("e" . "E") ("l" . "L")
52
("l" . "L") ("o" . "O"))))
53
(define ustra-f (ustr-new '("h" "e" "l" "l" "o")))
54
(define ustra-fl (ustr-new '("h" "e" "l")
56
(define ustra-l (ustr-new ()
57
'("h" "e" "l" "l" "o")))
58
(define ustrj-f (ustr-new '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ")
59
("ん" "ン" "ン") ("ご" "ゴ" "ゴ")
61
(define ustrj-fl (ustr-new '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ")
63
'(("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))))
64
(define ustrj-l (ustr-new ()
65
'(("に" "ニ" "ニ") ("ほ" "ホ" "ホ")
66
("ん" "ン" "ン") ("ご" "ゴ" "ゴ")
68
(define ustre (ustr-new ())))))
73
(define (test-ustr-new)
74
;; single sequence goes into former
75
(assert-uim-equal '(("o" "l" "l" "e" "h") . ())
76
'(ustr-new '("h" "e" "l" "l" "o")))
77
;; dual sequences are go into former and latter
78
(assert-uim-equal '(("l" "e" "h") . ("l" "o"))
79
'(ustr-new '("h" "e" "l")
81
;; latter sequence only
82
(assert-uim-equal '(() . ("h" "e" "l" "l" "o"))
84
'("h" "e" "l" "l" "o"))))
86
(define (test-ustr-whole-seq)
87
(assert-uim-equal '(("h" . "H") ("e" . "E") ("l" . "L") ("l" . "L") ("o" . "O"))
88
'(ustr-whole-seq ustr-fl))
89
(assert-uim-equal '(("h" . "H") ("e" . "E") ("l" . "L") ("l" . "L") ("o" . "O"))
90
'(ustr-whole-seq ustr-f))
91
(assert-uim-equal '(("h" . "H") ("e" . "E") ("l" . "L") ("l" . "L") ("o" . "O"))
92
'(ustr-whole-seq ustr-l))
93
(assert-uim-equal '("h" "e" "l" "l" "o")
94
'(ustr-whole-seq ustra-fl))
95
(assert-uim-equal '("h" "e" "l" "l" "o")
96
'(ustr-whole-seq ustra-f))
97
(assert-uim-equal '("h" "e" "l" "l" "o")
98
'(ustr-whole-seq ustra-l))
99
(assert-uim-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
100
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
101
'(ustr-whole-seq ustrj-fl))
102
(assert-uim-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
103
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
104
'(ustr-whole-seq ustrj-f))
105
(assert-uim-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
106
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
107
'(ustr-whole-seq ustrj-l)))
109
(define (test-ustr-former-seq)
110
(assert-uim-equal '(("h" . "H") ("e" . "E") ("l" . "L"))
111
'(ustr-former-seq ustr-fl))
112
(assert-uim-equal '(("h" . "H") ("e" . "E") ("l" . "L") ("l" . "L") ("o" . "O"))
113
'(ustr-former-seq ustr-f))
114
(assert-uim-equal '()
115
'(ustr-former-seq ustr-l))
116
(assert-uim-equal '("h" "e" "l")
117
'(ustr-former-seq ustra-fl))
118
(assert-uim-equal '("h" "e" "l" "l" "o")
119
'(ustr-former-seq ustra-f))
120
(assert-uim-equal '()
121
'(ustr-former-seq ustra-l))
122
(assert-uim-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン"))
123
'(ustr-former-seq ustrj-fl))
124
(assert-uim-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
125
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
126
'(ustr-former-seq ustrj-f))
127
(assert-uim-equal '()
128
'(ustr-former-seq ustrj-l)))
130
(define (test-ustr-latter-seq)
131
(assert-uim-equal '(("l" . "L") ("o" . "O"))
132
'(ustr-latter-seq ustr-fl))
133
(assert-uim-equal '()
134
'(ustr-latter-seq ustr-f))
135
(assert-uim-equal '(("h" . "H") ("e" . "E") ("l" . "L") ("l" . "L") ("o" . "O"))
136
'(ustr-latter-seq ustr-l))
137
(assert-uim-equal '("l" "o")
138
'(ustr-latter-seq ustra-fl))
139
(assert-uim-equal '()
140
'(ustr-latter-seq ustra-f))
141
(assert-uim-equal '("h" "e" "l" "l" "o")
142
'(ustr-latter-seq ustra-l))
143
(assert-uim-equal '(("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
144
'(ustr-latter-seq ustrj-fl))
145
(assert-uim-equal '()
146
'(ustr-latter-seq ustrj-f))
147
(assert-uim-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
148
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
149
'(ustr-latter-seq ustrj-l)))
151
(define (test-ustr-set-whole-seq!)
153
(assert-uim-equal '("h" "e" "l" "l" "o")
154
'(ustr-whole-seq ustra-fl))
155
(assert-uim-equal '("h" "e" "l")
156
'(ustr-former-seq ustra-fl))
157
(assert-uim-equal '("l" "o")
158
'(ustr-latter-seq ustra-fl))
159
(uim-eval '(ustr-set-whole-seq! ustra-fl '("w" "o" "r" "L" "d")))
160
(assert-uim-equal '("w" "o" "r" "L" "d")
161
'(ustr-whole-seq ustra-fl))
162
(assert-uim-equal '("w" "o" "r" "L" "d")
163
'(ustr-former-seq ustra-fl))
164
(assert-uim-equal '()
165
'(ustr-latter-seq ustra-fl))
167
(assert-uim-equal '("h" "e" "l" "l" "o")
168
'(ustr-whole-seq ustra-f))
169
(assert-uim-equal '("h" "e" "l" "l" "o")
170
'(ustr-former-seq ustra-f))
171
(assert-uim-equal '()
172
'(ustr-latter-seq ustra-f))
173
(uim-eval '(ustr-set-whole-seq! ustra-f '("w" "o" "r" "L" "d")))
174
(assert-uim-equal '("w" "o" "r" "L" "d")
175
'(ustr-whole-seq ustra-f))
176
(assert-uim-equal '("w" "o" "r" "L" "d")
177
'(ustr-former-seq ustra-f))
178
(assert-uim-equal '()
179
'(ustr-latter-seq ustra-f))
181
(assert-uim-equal '("h" "e" "l" "l" "o")
182
'(ustr-whole-seq ustra-l))
183
(assert-uim-equal '()
184
'(ustr-former-seq ustra-l))
185
(assert-uim-equal '("h" "e" "l" "l" "o")
186
'(ustr-latter-seq ustra-l))
187
(uim-eval '(ustr-set-whole-seq! ustra-l '("w" "o" "r" "L" "d")))
188
(assert-uim-equal '("w" "o" "r" "L" "d")
189
'(ustr-whole-seq ustra-l))
190
(assert-uim-equal '("w" "o" "r" "L" "d")
191
'(ustr-former-seq ustra-l))
192
(assert-uim-equal '()
193
'(ustr-latter-seq ustra-l)))
195
(define (test-ustr-set-former-seq!)
197
(assert-uim-equal '("h" "e" "l" "l" "o")
198
'(ustr-whole-seq ustra-fl))
199
(assert-uim-equal '("h" "e" "l")
200
'(ustr-former-seq ustra-fl))
201
(assert-uim-equal '("l" "o")
202
'(ustr-latter-seq ustra-fl))
203
(uim-eval '(ustr-set-former-seq! ustra-fl '("w" "o" "r" "L" "d")))
204
(assert-uim-equal '("w" "o" "r" "L" "d" "l" "o")
205
'(ustr-whole-seq ustra-fl))
206
(assert-uim-equal '("w" "o" "r" "L" "d")
207
'(ustr-former-seq ustra-fl))
208
(assert-uim-equal '("l" "o")
209
'(ustr-latter-seq ustra-fl))
211
(assert-uim-equal '("h" "e" "l" "l" "o")
212
'(ustr-whole-seq ustra-f))
213
(assert-uim-equal '("h" "e" "l" "l" "o")
214
'(ustr-former-seq ustra-f))
215
(assert-uim-equal '()
216
'(ustr-latter-seq ustra-f))
217
(uim-eval '(ustr-set-former-seq! ustra-f '("w" "o" "r" "L" "d")))
218
(assert-uim-equal '("w" "o" "r" "L" "d")
219
'(ustr-whole-seq ustra-f))
220
(assert-uim-equal '("w" "o" "r" "L" "d")
221
'(ustr-former-seq ustra-f))
222
(assert-uim-equal '()
223
'(ustr-latter-seq ustra-f))
225
(assert-uim-equal '("h" "e" "l" "l" "o")
226
'(ustr-whole-seq ustra-l))
227
(assert-uim-equal '()
228
'(ustr-former-seq ustra-l))
229
(assert-uim-equal '("h" "e" "l" "l" "o")
230
'(ustr-latter-seq ustra-l))
231
(uim-eval '(ustr-set-former-seq! ustra-l '("w" "o" "r" "L" "d")))
232
(assert-uim-equal '("w" "o" "r" "L" "d" "h" "e" "l" "l" "o")
233
'(ustr-whole-seq ustra-l))
234
(assert-uim-equal '("w" "o" "r" "L" "d")
235
'(ustr-former-seq ustra-l))
236
(assert-uim-equal '("h" "e" "l" "l" "o")
237
'(ustr-latter-seq ustra-l)))
239
(define (test-ustr-set-latter-seq!)
241
(assert-uim-equal '("h" "e" "l" "l" "o")
242
'(ustr-whole-seq ustra-fl))
243
(assert-uim-equal '("h" "e" "l")
244
'(ustr-former-seq ustra-fl))
245
(assert-uim-equal '("l" "o")
246
'(ustr-latter-seq ustra-fl))
247
(uim-eval '(ustr-set-latter-seq! ustra-fl '("w" "o" "r" "L" "d")))
248
(assert-uim-equal '("h" "e" "l" "w" "o" "r" "L" "d")
249
'(ustr-whole-seq ustra-fl))
250
(assert-uim-equal '("h" "e" "l")
251
'(ustr-former-seq ustra-fl))
252
(assert-uim-equal '("w" "o" "r" "L" "d")
253
'(ustr-latter-seq ustra-fl))
255
(assert-uim-equal '("h" "e" "l" "l" "o")
256
'(ustr-whole-seq ustra-f))
257
(assert-uim-equal '("h" "e" "l" "l" "o")
258
'(ustr-former-seq ustra-f))
259
(assert-uim-equal '()
260
'(ustr-latter-seq ustra-f))
261
(uim-eval '(ustr-set-latter-seq! ustra-f '("w" "o" "r" "L" "d")))
262
(assert-uim-equal '("h" "e" "l" "l" "o" "w" "o" "r" "L" "d")
263
'(ustr-whole-seq ustra-f))
264
(assert-uim-equal '("h" "e" "l" "l" "o")
265
'(ustr-former-seq ustra-f))
266
(assert-uim-equal '("w" "o" "r" "L" "d")
267
'(ustr-latter-seq ustra-f))
269
(assert-uim-equal '("h" "e" "l" "l" "o")
270
'(ustr-whole-seq ustra-l))
271
(assert-uim-equal '()
272
'(ustr-former-seq ustra-l))
273
(assert-uim-equal '("h" "e" "l" "l" "o")
274
'(ustr-latter-seq ustra-l))
275
(uim-eval '(ustr-set-latter-seq! ustra-l '("w" "o" "r" "L" "d")))
276
(assert-uim-equal '("w" "o" "r" "L" "d")
277
'(ustr-whole-seq ustra-l))
278
(assert-uim-equal '()
279
'(ustr-former-seq ustra-l))
280
(assert-uim-equal '("w" "o" "r" "L" "d")
281
'(ustr-latter-seq ustra-l)))
283
(define (test-ustr-empty?)
284
(assert-false (uim-bool '(ustr-empty? ustr-fl)))
285
(assert-false (uim-bool '(ustr-empty? ustr-f)))
286
(assert-false (uim-bool '(ustr-empty? ustr-l)))
288
(assert-false (uim-bool '(ustr-empty? ustra-fl)))
289
(assert-false (uim-bool '(ustr-empty? ustra-f)))
290
(assert-false (uim-bool '(ustr-empty? ustra-l)))
292
(assert-false (uim-bool '(ustr-empty? ustrj-fl)))
293
(assert-false (uim-bool '(ustr-empty? ustrj-f)))
294
(assert-false (uim-bool '(ustr-empty? ustrj-l)))
296
(assert-uim-equal '(() . ())
298
(assert-uim-true '(ustr-empty? ustre)))
300
(define (test-ustr-clear!)
301
(assert-uim-false '(ustr-empty? ustra-fl))
302
(uim-eval '(ustr-clear! ustra-fl))
303
(assert-uim-true '(ustr-empty? ustra-fl))
305
(assert-uim-false '(ustr-empty? ustra-f))
306
(uim-eval '(ustr-clear! ustra-f))
307
(assert-uim-true '(ustr-empty? ustra-f))
309
(assert-uim-false '(ustr-empty? ustra-l))
310
(uim-eval '(ustr-clear! ustra-l))
311
(assert-uim-true '(ustr-empty? ustra-l))
313
(assert-uim-true '(ustr-empty? ustre))
314
(uim-eval '(ustr-clear! ustre))
315
(assert-uim-true '(ustr-empty? ustre)))
317
(define (test-ustr-clear-former!)
318
(assert-uim-false '(ustr-empty? ustra-fl))
319
(uim-eval '(ustr-clear-former! ustra-fl))
320
(assert-uim-false '(ustr-empty? ustra-fl))
322
(assert-uim-false '(ustr-empty? ustra-f))
323
(uim-eval '(ustr-clear-former! ustra-f))
324
(assert-uim-true '(ustr-empty? ustra-f))
326
(assert-uim-false '(ustr-empty? ustra-l))
327
(uim-eval '(ustr-clear-former! ustra-l))
328
(assert-uim-false '(ustr-empty? ustra-l))
330
(assert-uim-true '(ustr-empty? ustre))
331
(uim-eval '(ustr-clear-former! ustre))
332
(assert-uim-true '(ustr-empty? ustre)))
334
(define (test-ustr-clear-latter!)
335
(assert-uim-false '(ustr-empty? ustra-fl))
336
(uim-eval '(ustr-clear-latter! ustra-fl))
337
(assert-uim-false '(ustr-empty? ustra-fl))
339
(assert-uim-false '(ustr-empty? ustra-f))
340
(uim-eval '(ustr-clear-latter! ustra-f))
341
(assert-uim-false '(ustr-empty? ustra-f))
343
(assert-uim-false '(ustr-empty? ustra-l))
344
(uim-eval '(ustr-clear-latter! ustra-l))
345
(assert-uim-true '(ustr-empty? ustra-l))
347
(assert-uim-true '(ustr-empty? ustre))
348
(uim-eval '(ustr-clear-latter! ustre))
349
(assert-uim-true '(ustr-empty? ustre)))
351
(define (test-ustr-copy!)
352
(assert-uim-false '(equal? ustr-fl ustra-fl))
353
(uim-eval '(ustr-copy! ustr-fl ustra-fl))
354
(assert-uim-true '(equal? ustr-fl ustra-fl))
356
(assert-uim-false '(equal? ustr-f ustra-f))
357
(uim-eval '(ustr-copy! ustr-f ustra-f))
358
(assert-uim-true '(equal? ustr-f ustra-f))
360
(assert-uim-false '(equal? ustr-l ustra-l))
361
(uim-eval '(ustr-copy! ustr-l ustra-l))
362
(assert-uim-true '(equal? ustr-l ustra-l)))
365
(assert-uim-true '(ustr= equal? ustr-fl ustr-fl))
366
(assert-uim-true '(ustr= equal? ustr-fl ustr-f))
367
(assert-uim-true '(ustr= equal? ustr-f ustr-fl))
368
(assert-uim-true '(ustr= equal? ustr-fl ustr-l))
369
(assert-uim-true '(ustr= equal? ustr-l ustr-fl))
370
(assert-uim-true '(ustr= equal? ustr-f ustr-f))
371
(assert-uim-true '(ustr= equal? ustr-l ustr-f))
372
(assert-uim-true '(ustr= equal? ustr-f ustr-l))
373
(assert-uim-true '(ustr= equal? ustr-l ustr-l))
374
(assert-uim-false '(ustr= equal? ustr-l ustre))
375
(assert-uim-false '(ustr= equal? ustre ustr-l))
377
(assert-uim-true '(ustr= string=? ustra-fl ustra-fl))
378
(assert-uim-true '(ustr= string=? ustra-fl ustra-f))
379
(assert-uim-true '(ustr= string=? ustra-f ustra-fl))
380
(assert-uim-true '(ustr= string=? ustra-fl ustra-l))
381
(assert-uim-true '(ustr= string=? ustra-l ustra-fl))
382
(assert-uim-true '(ustr= string=? ustra-f ustra-f))
383
(assert-uim-true '(ustr= string=? ustra-l ustra-f))
384
(assert-uim-true '(ustr= string=? ustra-f ustra-l))
385
(assert-uim-true '(ustr= string=? ustra-l ustra-l))
386
(assert-uim-false '(ustr= string=? ustra-fl ustre))
387
(assert-uim-false '(ustr= string=? ustre ustra-fl))
388
(assert-uim-false '(ustr= string=? ustra-f ustre))
389
(assert-uim-false '(ustr= string=? ustre ustra-f))
390
(assert-uim-false '(ustr= string=? ustra-l ustre))
391
(assert-uim-false '(ustr= string=? ustre ustra-l))
392
(uim-eval '(ustr-set-former-seq! ustra-f '("h" "e" "l" "l" "o" "!")))
393
(assert-uim-false '(ustr= string=? ustra-fl ustra-f))
394
(assert-uim-false '(ustr= string=? ustra-f ustra-fl))
395
(assert-uim-false '(ustr= string=? ustra-l ustra-f))
396
(assert-uim-false '(ustr= string=? ustra-f ustra-l))
397
(assert-uim-true '(ustr= string=? ustra-f ustra-f))
399
(assert-uim-true '(ustr= equal? ustrj-fl ustrj-fl))
400
(assert-uim-true '(ustr= equal? ustrj-fl ustrj-f))
401
(assert-uim-true '(ustr= equal? ustrj-f ustrj-fl))
402
(assert-uim-true '(ustr= equal? ustrj-fl ustrj-l))
403
(assert-uim-true '(ustr= equal? ustrj-l ustrj-fl))
404
(assert-uim-true '(ustr= equal? ustrj-f ustrj-f))
405
(assert-uim-true '(ustr= equal? ustrj-l ustrj-f))
406
(assert-uim-true '(ustr= equal? ustrj-f ustrj-l))
407
(assert-uim-true '(ustr= equal? ustrj-l ustrj-l))
408
(assert-uim-false '(ustr= equal? ustrj-l ustre))
409
(assert-uim-false '(ustr= equal? ustre ustrj-l)))
411
(define (test-ustr-length)
413
'(ustr-length ustr-fl))
415
'(ustr-length ustr-f))
417
'(ustr-length ustr-l))
419
'(ustr-length ustra-fl))
421
'(ustr-length ustra-f))
423
'(ustr-length ustra-l))
425
'(ustr-length ustrj-fl))
427
'(ustr-length ustrj-f))
429
'(ustr-length ustrj-l))
431
'(ustr-length ustre)))
433
(define (test-ustr-nth)
434
(assert-uim-equal "h"
435
'(ustr-nth ustra-fl 0))
436
(assert-uim-equal "e"
437
'(ustr-nth ustra-fl 1))
438
(assert-uim-equal "l"
439
'(ustr-nth ustra-fl 2))
440
(assert-uim-equal "l"
441
'(ustr-nth ustra-fl 3))
442
(assert-uim-equal "o"
443
'(ustr-nth ustra-fl 4))
444
(assert-uim-error '(ustr-nth ustra-fl 5))
445
(assert-uim-error '(ustr-nth ustra-fl -1))
447
(assert-uim-equal "h"
448
'(ustr-nth ustra-f 0))
449
(assert-uim-equal "e"
450
'(ustr-nth ustra-f 1))
451
(assert-uim-equal "l"
452
'(ustr-nth ustra-f 2))
453
(assert-uim-equal "l"
454
'(ustr-nth ustra-f 3))
455
(assert-uim-equal "o"
456
'(ustr-nth ustra-f 4))
457
(assert-uim-error '(ustr-nth ustra-f 5))
458
(assert-uim-error '(ustr-nth ustra-f -1))
460
(assert-uim-equal "h"
461
'(ustr-nth ustra-l 0))
462
(assert-uim-equal "e"
463
'(ustr-nth ustra-l 1))
464
(assert-uim-equal "l"
465
'(ustr-nth ustra-l 2))
466
(assert-uim-equal "l"
467
'(ustr-nth ustra-l 3))
468
(assert-uim-equal "o"
469
'(ustr-nth ustra-l 4))
470
(assert-uim-error '(ustr-nth ustra-l 5))
471
(assert-uim-error '(ustr-nth ustra-l -1))
473
(assert-uim-error '(ustr-nth ustre 0)))
475
(define (test-ustr-set-nth!)
476
(assert-uim-equal "h"
477
'(ustr-nth ustra-fl 0))
478
(assert-uim-equal "e"
479
'(ustr-nth ustra-fl 1))
480
(assert-uim-equal "l"
481
'(ustr-nth ustra-fl 2))
482
(assert-uim-equal "l"
483
'(ustr-nth ustra-fl 3))
484
(assert-uim-equal "o"
485
'(ustr-nth ustra-fl 4))
486
(assert-uim-error '(ustr-nth ustra-fl 5))
487
(assert-uim-error '(ustr-nth ustra-fl -1))
490
'(ustr-length ustra-fl))
492
'(ustr-cursor-pos ustra-fl))
493
(uim-eval '(ustr-set-nth! ustra-fl 0 "H"))
494
(assert-uim-equal "H"
495
'(ustr-nth ustra-fl 0))
496
(assert-uim-equal '("H" "e" "l")
497
'(ustr-former-seq ustra-fl))
498
(assert-uim-equal '("l" "o")
499
'(ustr-latter-seq ustra-fl))
501
'(ustr-length ustra-fl))
503
'(ustr-cursor-pos ustra-fl))
506
'(ustr-length ustra-fl))
508
'(ustr-cursor-pos ustra-fl))
509
(uim-eval '(ustr-set-nth! ustra-fl 1 "E"))
510
(assert-uim-equal "E"
511
'(ustr-nth ustra-fl 1))
512
(assert-uim-equal '("H" "E" "l")
513
'(ustr-former-seq ustra-fl))
514
(assert-uim-equal '("l" "o")
515
'(ustr-latter-seq ustra-fl))
517
'(ustr-length ustra-fl))
519
'(ustr-cursor-pos ustra-fl))
522
'(ustr-length ustra-fl))
524
'(ustr-cursor-pos ustra-fl))
525
(uim-eval '(ustr-set-nth! ustra-fl 2 "L"))
526
(assert-uim-equal "L"
527
'(ustr-nth ustra-fl 2))
528
(assert-uim-equal '("H" "E" "L")
529
'(ustr-former-seq ustra-fl))
530
(assert-uim-equal '("l" "o")
531
'(ustr-latter-seq ustra-fl))
533
'(ustr-length ustra-fl))
535
'(ustr-cursor-pos ustra-fl))
538
'(ustr-length ustra-fl))
540
'(ustr-cursor-pos ustra-fl))
541
(uim-eval '(ustr-set-nth! ustra-fl 3 "|"))
542
(assert-uim-equal "|"
543
'(ustr-nth ustra-fl 3))
544
(assert-uim-equal '("H" "E" "L")
545
'(ustr-former-seq ustra-fl))
546
(assert-uim-equal '("|" "o")
547
'(ustr-latter-seq ustra-fl))
549
'(ustr-length ustra-fl))
551
'(ustr-cursor-pos ustra-fl))
554
'(ustr-length ustra-fl))
556
'(ustr-cursor-pos ustra-fl))
557
(uim-eval '(ustr-set-nth! ustra-fl 4 "O"))
558
(assert-uim-equal "O"
559
'(ustr-nth ustra-fl 4))
560
(assert-uim-equal '("H" "E" "L")
561
'(ustr-former-seq ustra-fl))
562
(assert-uim-equal '("|" "O")
563
'(ustr-latter-seq ustra-fl))
565
'(ustr-length ustra-fl))
567
'(ustr-cursor-pos ustra-fl))
570
'(ustr-length ustra-fl))
572
'(ustr-cursor-pos ustra-fl))
573
(assert-uim-error '(ustr-set-nth! ustra-fl 5 "5"))
574
(assert-uim-error '(ustr-nth ustra-fl 5))
575
(assert-uim-equal '("H" "E" "L")
576
'(ustr-former-seq ustra-fl))
577
(assert-uim-equal '("|" "O")
578
'(ustr-latter-seq ustra-fl))
580
'(ustr-length ustra-fl))
582
'(ustr-cursor-pos ustra-fl))
583
;; position 5 in former-str
584
(assert-uim-equal '("h" "e" "l" "l" "o")
585
'(ustr-former-seq ustra-f))
586
(assert-uim-equal '()
587
'(ustr-latter-seq ustra-f))
589
'(ustr-length ustra-f))
591
'(ustr-cursor-pos ustra-f))
592
(assert-uim-error '(ustr-set-nth! ustra-f 5 "5"))
593
(assert-uim-error '(ustr-nth ustra-f 5))
594
(assert-uim-equal '("h" "e" "l" "l" "o")
595
'(ustr-former-seq ustra-f))
596
(assert-uim-equal '()
597
'(ustr-latter-seq ustra-f))
599
'(ustr-length ustra-f))
601
'(ustr-cursor-pos ustra-f))
602
;; position 4 in former-str
603
(assert-uim-equal '("h" "e" "l" "l" "o")
604
'(ustr-former-seq ustra-f))
605
(assert-uim-equal '()
606
'(ustr-latter-seq ustra-f))
608
'(ustr-length ustra-f))
610
'(ustr-cursor-pos ustra-f))
611
(uim-eval '(ustr-set-nth! ustra-f 4 "O"))
612
(assert-uim-equal "O"
613
'(ustr-nth ustra-f 4))
614
(assert-uim-equal '("h" "e" "l" "l" "O")
615
'(ustr-former-seq ustra-f))
616
(assert-uim-equal '()
617
'(ustr-latter-seq ustra-f))
619
'(ustr-length ustra-f))
621
'(ustr-cursor-pos ustra-f))
622
;; position 0 in latter-str
623
(assert-uim-equal '()
624
'(ustr-former-seq ustra-l))
625
(assert-uim-equal '("h" "e" "l" "l" "o")
626
'(ustr-latter-seq ustra-l))
628
'(ustr-length ustra-l))
630
'(ustr-cursor-pos ustra-l))
631
(uim-eval '(ustr-set-nth! ustra-l 0 "H"))
632
(assert-uim-equal "H"
633
'(ustr-nth ustra-l 0))
634
(assert-uim-equal '()
635
'(ustr-former-seq ustra-l))
636
(assert-uim-equal '("H" "e" "l" "l" "o")
637
'(ustr-latter-seq ustra-l))
639
'(ustr-length ustra-l))
641
'(ustr-cursor-pos ustra-l)))
643
(define (test-ustr-ref)
644
(assert-true (uim-bool '(eq? (ustr-ref ustra-fl 0)
645
(nthcdr 2 (ustr-former ustra-fl)))))
646
(assert-true (uim-bool '(eq? (ustr-ref ustra-fl 1)
647
(nthcdr 1 (ustr-former ustra-fl)))))
648
(assert-true (uim-bool '(eq? (ustr-ref ustra-fl 2)
649
(nthcdr 0 (ustr-former ustra-fl)))))
650
(assert-true (uim-bool '(eq? (ustr-ref ustra-fl 3)
651
(nthcdr 0 (ustr-latter ustra-fl)))))
652
(assert-true (uim-bool '(eq? (ustr-ref ustra-fl 4)
653
(nthcdr 1 (ustr-latter ustra-fl)))))
654
(assert-uim-error '(ustr-ref ustra-fl 5))
655
(assert-uim-error '(ustr-ref ustra-fl -1))
657
(assert-true (uim-bool '(eq? (ustr-ref ustra-f 4)
658
(nthcdr 0 (ustr-former ustra-f)))))
659
(assert-uim-error '(ustr-ref ustra-f 5))
661
(assert-true (uim-bool '(eq? (ustr-ref ustra-l 0)
662
(nthcdr 0 (ustr-latter ustra-l))))))
664
(define (test-ustr-append!)
666
(assert-uim-equal '("ん" "ン" "ン")
667
'(ustr-cursor-backside ustrj-fl))
669
'(ustr-length ustrj-fl))
671
'(ustr-cursor-pos ustrj-fl))
672
(uim-eval '(ustr-append! ustrj-fl '(("んー" "ンー" "ンー") ("か" "カ" "カ")
674
(assert-uim-equal '("ん" "ン" "ン")
675
'(ustr-cursor-backside ustrj-fl))
677
'(ustr-length ustrj-fl))
679
'(ustr-cursor-pos ustrj-fl))
680
(assert-uim-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
681
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ")
682
("んー" "ンー" "ンー") ("か" "カ" "カ") ("よ" "ヨ" "ヨ"))
683
'(ustr-whole-seq ustrj-fl))
685
(assert-uim-equal '("じゃ" "ジャ" "ジャ")
686
'(ustr-cursor-backside ustrj-f))
688
'(ustr-length ustrj-f))
690
'(ustr-cursor-pos ustrj-f))
691
(uim-eval '(ustr-append! ustrj-f '(("んー" "ンー" "ンー") ("か" "カ" "カ")
693
(assert-uim-equal '("じゃ" "ジャ" "ジャ")
694
'(ustr-cursor-backside ustrj-f))
696
'(ustr-length ustrj-f))
698
'(ustr-cursor-pos ustrj-f))
699
(assert-uim-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
700
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ")
701
("んー" "ンー" "ンー") ("か" "カ" "カ") ("よ" "ヨ" "ヨ"))
702
'(ustr-whole-seq ustrj-f))
704
(assert-uim-error '(ustr-cursor-backside ustrj-l))
706
'(ustr-length ustrj-l))
708
'(ustr-cursor-pos ustrj-l))
709
(uim-eval '(ustr-append! ustrj-l '(("んー" "ンー" "ンー") ("か" "カ" "カ")
711
(assert-uim-error '(ustr-cursor-backside ustrj-l))
713
'(ustr-length ustrj-l))
715
'(ustr-cursor-pos ustrj-l))
716
(assert-uim-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
717
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ")
718
("んー" "ンー" "ンー") ("か" "カ" "カ") ("よ" "ヨ" "ヨ"))
719
'(ustr-whole-seq ustrj-l))
721
(assert-uim-error '(ustr-cursor-backside ustre))
723
'(ustr-length ustre))
725
'(ustr-cursor-pos ustre))
726
(uim-eval '(ustr-append! ustre '(("んー" "ンー" "ンー") ("か" "カ" "カ")
728
(assert-uim-error '(ustr-cursor-backside ustre))
730
'(ustr-length ustre))
732
'(ustr-cursor-pos ustre))
733
(assert-uim-equal '(("んー" "ンー" "ンー") ("か" "カ" "カ") ("よ" "ヨ" "ヨ"))
734
'(ustr-whole-seq ustre)))
736
(define (test-ustr-append!-#2)
738
(assert-uim-equal '("ん" "ン" "ン")
739
'(ustr-cursor-backside ustrj-fl))
741
'(ustr-length ustrj-fl))
743
'(ustr-cursor-pos ustrj-fl))
744
(uim-eval '(ustr-append! ustrj-fl ()))
745
(assert-uim-equal '("ん" "ン" "ン")
746
'(ustr-cursor-backside ustrj-fl))
748
'(ustr-length ustrj-fl))
750
'(ustr-cursor-pos ustrj-fl))
751
(assert-uim-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
752
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
753
'(ustr-whole-seq ustrj-fl))
755
(assert-uim-equal '("じゃ" "ジャ" "ジャ")
756
'(ustr-cursor-backside ustrj-f))
758
'(ustr-length ustrj-f))
760
'(ustr-cursor-pos ustrj-f))
761
(uim-eval '(ustr-append! ustrj-f ()))
762
(assert-uim-equal '("じゃ" "ジャ" "ジャ")
763
'(ustr-cursor-backside ustrj-f))
765
'(ustr-length ustrj-f))
767
'(ustr-cursor-pos ustrj-f))
768
(assert-uim-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
769
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
770
'(ustr-whole-seq ustrj-f))
772
(assert-uim-error '(ustr-cursor-backside ustrj-l))
774
'(ustr-length ustrj-l))
776
'(ustr-cursor-pos ustrj-l))
777
(uim-eval '(ustr-append! ustrj-l ()))
778
(assert-uim-error '(ustr-cursor-backside ustrj-l))
780
'(ustr-length ustrj-l))
782
'(ustr-cursor-pos ustrj-l))
783
(assert-uim-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
784
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
785
'(ustr-whole-seq ustrj-l))
787
(assert-uim-error '(ustr-cursor-backside ustre))
789
'(ustr-length ustre))
791
'(ustr-cursor-pos ustre))
792
(uim-eval '(ustr-append! ustre ()))
793
(assert-uim-error '(ustr-cursor-backside ustre))
795
'(ustr-length ustre))
797
'(ustr-cursor-pos ustre)))
799
(define (test-ustr-prepend!)
801
(assert-uim-equal '("ん" "ン" "ン")
802
'(ustr-cursor-backside ustrj-fl))
804
'(ustr-length ustrj-fl))
806
'(ustr-cursor-pos ustrj-fl))
807
(uim-eval '(ustr-prepend! ustrj-fl '(("んー" "ンー" "ンー") ("か" "カ" "カ")
809
(assert-uim-equal '("ん" "ン" "ン")
810
'(ustr-cursor-backside ustrj-fl))
812
'(ustr-length ustrj-fl))
814
'(ustr-cursor-pos ustrj-fl))
815
(assert-uim-equal '(("んー" "ンー" "ンー") ("か" "カ" "カ") ("よ" "ヨ" "ヨ")
816
("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
817
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
818
'(ustr-whole-seq ustrj-fl))
820
(assert-uim-equal '("じゃ" "ジャ" "ジャ")
821
'(ustr-cursor-backside ustrj-f))
823
'(ustr-length ustrj-f))
825
'(ustr-cursor-pos ustrj-f))
826
(uim-eval '(ustr-prepend! ustrj-f '(("んー" "ンー" "ンー") ("か" "カ" "カ")
828
(assert-uim-equal '("じゃ" "ジャ" "ジャ")
829
'(ustr-cursor-backside ustrj-f))
831
'(ustr-length ustrj-f))
833
'(ustr-cursor-pos ustrj-f))
834
(assert-uim-equal '(("んー" "ンー" "ンー") ("か" "カ" "カ") ("よ" "ヨ" "ヨ")
835
("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
836
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
837
'(ustr-whole-seq ustrj-f))
839
(assert-uim-error '(ustr-cursor-backside ustrj-l))
841
'(ustr-length ustrj-l))
843
'(ustr-cursor-pos ustrj-l))
844
(uim-eval '(ustr-prepend! ustrj-l '(("んー" "ンー" "ンー") ("か" "カ" "カ")
846
(assert-uim-equal '("よ" "ヨ" "ヨ")
847
'(ustr-cursor-backside ustrj-l))
849
'(ustr-length ustrj-l))
851
'(ustr-cursor-pos ustrj-l))
852
(assert-uim-equal '(("んー" "ンー" "ンー") ("か" "カ" "カ") ("よ" "ヨ" "ヨ")
853
("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
854
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
855
'(ustr-whole-seq ustrj-l))
857
(assert-uim-error '(ustr-cursor-backside ustre))
859
'(ustr-length ustre))
861
'(ustr-cursor-pos ustre))
862
(uim-eval '(ustr-prepend! ustre '(("んー" "ンー" "ンー") ("か" "カ" "カ")
864
(assert-uim-equal '("よ" "ヨ" "ヨ")
865
'(ustr-cursor-backside ustre))
867
'(ustr-length ustre))
869
'(ustr-cursor-pos ustre))
870
(assert-uim-equal '(("んー" "ンー" "ンー") ("か" "カ" "カ") ("よ" "ヨ" "ヨ"))
871
'(ustr-whole-seq ustre)))
873
(define (test-ustr-prepend!-#2)
875
(assert-uim-equal '("ん" "ン" "ン")
876
'(ustr-cursor-backside ustrj-fl))
878
'(ustr-length ustrj-fl))
880
'(ustr-cursor-pos ustrj-fl))
881
(uim-eval '(ustr-prepend! ustrj-fl ()))
882
(assert-uim-equal '("ん" "ン" "ン")
883
'(ustr-cursor-backside ustrj-fl))
885
'(ustr-length ustrj-fl))
887
'(ustr-cursor-pos ustrj-fl))
888
(assert-uim-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
889
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
890
'(ustr-whole-seq ustrj-fl))
892
(assert-uim-equal '("じゃ" "ジャ" "ジャ")
893
'(ustr-cursor-backside ustrj-f))
895
'(ustr-length ustrj-f))
897
'(ustr-cursor-pos ustrj-f))
898
(uim-eval '(ustr-prepend! ustrj-f ()))
899
(assert-uim-equal '("じゃ" "ジャ" "ジャ")
900
'(ustr-cursor-backside ustrj-f))
902
'(ustr-length ustrj-f))
904
'(ustr-cursor-pos ustrj-f))
905
(assert-uim-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
906
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
907
'(ustr-whole-seq ustrj-f))
909
(assert-uim-error '(ustr-cursor-backside ustrj-l))
911
'(ustr-length ustrj-l))
913
'(ustr-cursor-pos ustrj-l))
914
(uim-eval '(ustr-prepend! ustrj-l ()))
915
(assert-uim-error '(ustr-cursor-backside ustrj-l))
917
'(ustr-length ustrj-l))
919
'(ustr-cursor-pos ustrj-l))
920
(assert-uim-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
921
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
922
'(ustr-whole-seq ustrj-l))
924
(assert-uim-error '(ustr-cursor-backside ustre))
926
'(ustr-length ustre))
928
'(ustr-cursor-pos ustre))
929
(uim-eval '(ustr-prepend! ustre ()))
930
(assert-uim-error '(ustr-cursor-backside ustre))
932
'(ustr-length ustre))
934
'(ustr-cursor-pos ustre)))
936
(define (test-map-ustr-whole)
938
(assert-uim-equal '("h" "e" "l" "l" "o")
939
'(map-ustr-whole car ustr-fl))
940
(assert-uim-equal '("H" "E" "L" "L" "O")
941
'(map-ustr-whole cdr ustr-fl))
942
(assert-uim-equal '("に" "ほ" "ん" "ご" "じゃ")
943
'(map-ustr-whole ja-kana-hiragana ustrj-fl))
944
(assert-uim-equal '("ニ" "ホ" "ン" "ゴ" "ジャ")
945
'(map-ustr-whole ja-kana-katakana ustrj-fl))
946
(assert-uim-equal '("ニ" "ホ" "ン" "ゴ" "ジャ")
947
'(map-ustr-whole ja-kana-hankaku ustrj-fl))
949
(assert-uim-equal '("h" "e" "l" "l" "o")
950
'(map-ustr-whole car ustr-f))
951
(assert-uim-equal '("H" "E" "L" "L" "O")
952
'(map-ustr-whole cdr ustr-f))
953
(assert-uim-equal '("に" "ほ" "ん" "ご" "じゃ")
954
'(map-ustr-whole ja-kana-hiragana ustrj-f))
955
(assert-uim-equal '("ニ" "ホ" "ン" "ゴ" "ジャ")
956
'(map-ustr-whole ja-kana-katakana ustrj-f))
957
(assert-uim-equal '("ニ" "ホ" "ン" "ゴ" "ジャ")
958
'(map-ustr-whole ja-kana-hankaku ustrj-f))
960
(assert-uim-equal '("h" "e" "l" "l" "o")
961
'(map-ustr-whole car ustr-l))
962
(assert-uim-equal '("H" "E" "L" "L" "O")
963
'(map-ustr-whole cdr ustr-l))
964
(assert-uim-equal '("に" "ほ" "ん" "ご" "じゃ")
965
'(map-ustr-whole ja-kana-hiragana ustrj-l))
966
(assert-uim-equal '("ニ" "ホ" "ン" "ゴ" "ジャ")
967
'(map-ustr-whole ja-kana-katakana ustrj-l))
968
(assert-uim-equal '("ニ" "ホ" "ン" "ゴ" "ジャ")
969
'(map-ustr-whole ja-kana-hankaku ustrj-l))
971
(assert-uim-equal '()
972
'(map-ustr-whole cdr ustre)))
974
(define (test-map-ustr-former)
976
(assert-uim-equal '("h" "e" "l")
977
'(map-ustr-former car ustr-fl))
978
(assert-uim-equal '("H" "E" "L")
979
'(map-ustr-former cdr ustr-fl))
980
(assert-uim-equal '("に" "ほ" "ん")
981
'(map-ustr-former ja-kana-hiragana ustrj-fl))
982
(assert-uim-equal '("ニ" "ホ" "ン")
983
'(map-ustr-former ja-kana-katakana ustrj-fl))
984
(assert-uim-equal '("ニ" "ホ" "ン")
985
'(map-ustr-former ja-kana-hankaku ustrj-fl))
987
(assert-uim-equal '("h" "e" "l" "l" "o")
988
'(map-ustr-former car ustr-f))
989
(assert-uim-equal '("H" "E" "L" "L" "O")
990
'(map-ustr-former cdr ustr-f))
991
(assert-uim-equal '("に" "ほ" "ん" "ご" "じゃ")
992
'(map-ustr-former ja-kana-hiragana ustrj-f))
993
(assert-uim-equal '("ニ" "ホ" "ン" "ゴ" "ジャ")
994
'(map-ustr-former ja-kana-katakana ustrj-f))
995
(assert-uim-equal '("ニ" "ホ" "ン" "ゴ" "ジャ")
996
'(map-ustr-former ja-kana-hankaku ustrj-f))
998
(assert-uim-equal '()
999
'(map-ustr-former car ustr-l))
1000
(assert-uim-equal '()
1001
'(map-ustr-former cdr ustr-l))
1002
(assert-uim-equal '()
1003
'(map-ustr-former ja-kana-hiragana ustrj-l))
1004
(assert-uim-equal '()
1005
'(map-ustr-former ja-kana-katakana ustrj-l))
1006
(assert-uim-equal '()
1007
'(map-ustr-former ja-kana-hankaku ustrj-l))
1009
(assert-uim-equal '()
1010
'(map-ustr-former cdr ustre)))
1012
(define (test-map-ustr-latter)
1014
(assert-uim-equal '("l" "o")
1015
'(map-ustr-latter car ustr-fl))
1016
(assert-uim-equal '("L" "O")
1017
'(map-ustr-latter cdr ustr-fl))
1018
(assert-uim-equal '("ご" "じゃ")
1019
'(map-ustr-latter ja-kana-hiragana ustrj-fl))
1020
(assert-uim-equal '("ゴ" "ジャ")
1021
'(map-ustr-latter ja-kana-katakana ustrj-fl))
1022
(assert-uim-equal '("ゴ" "ジャ")
1023
'(map-ustr-latter ja-kana-hankaku ustrj-fl))
1025
(assert-uim-equal '()
1026
'(map-ustr-latter car ustr-f))
1027
(assert-uim-equal '()
1028
'(map-ustr-latter cdr ustr-f))
1029
(assert-uim-equal '()
1030
'(map-ustr-latter ja-kana-hiragana ustrj-f))
1031
(assert-uim-equal '()
1032
'(map-ustr-latter ja-kana-katakana ustrj-f))
1033
(assert-uim-equal '()
1034
'(map-ustr-latter ja-kana-hankaku ustrj-f))
1036
(assert-uim-equal '("h" "e" "l" "l" "o")
1037
'(map-ustr-latter car ustr-l))
1038
(assert-uim-equal '("H" "E" "L" "L" "O")
1039
'(map-ustr-latter cdr ustr-l))
1040
(assert-uim-equal '("に" "ほ" "ん" "ご" "じゃ")
1041
'(map-ustr-latter ja-kana-hiragana ustrj-l))
1042
(assert-uim-equal '("ニ" "ホ" "ン" "ゴ" "ジャ")
1043
'(map-ustr-latter ja-kana-katakana ustrj-l))
1044
(assert-uim-equal '("ニ" "ホ" "ン" "ゴ" "ジャ")
1045
'(map-ustr-latter ja-kana-hankaku ustrj-l))
1047
(assert-uim-equal '()
1048
'(map-ustr-latter cdr ustre)))
1050
(define (test-append-map-ustr-whole)
1051
(assert-uim-equal '("ニ" "ニ" "ホ" "ホ" "ン" "ン" "ゴ" "ゴ" "ジャ" "ジャ")
1052
'(append-map-ustr-whole cdr ustrj-fl))
1053
(assert-uim-equal '("ニ" "ニ" "ホ" "ホ" "ン" "ン" "ゴ" "ゴ" "ジャ" "ジャ")
1054
'(append-map-ustr-whole cdr ustrj-f))
1055
(assert-uim-equal '("ニ" "ニ" "ホ" "ホ" "ン" "ン" "ゴ" "ゴ" "ジャ" "ジャ")
1056
'(append-map-ustr-whole cdr ustrj-l))
1057
(assert-uim-equal '()
1058
'(append-map-ustr-whole cdr ustre)))
1060
(define (test-append-map-ustr-former)
1061
(assert-uim-equal '("ニ" "ニ" "ホ" "ホ" "ン" "ン")
1062
'(append-map-ustr-former cdr ustrj-fl))
1063
(assert-uim-equal '("ニ" "ニ" "ホ" "ホ" "ン" "ン" "ゴ" "ゴ" "ジャ" "ジャ")
1064
'(append-map-ustr-former cdr ustrj-f))
1065
(assert-uim-equal '()
1066
'(append-map-ustr-former cdr ustrj-l))
1067
(assert-uim-equal '()
1068
'(append-map-ustr-former cdr ustre)))
1070
(define (test-append-map-ustr-latter)
1071
(assert-uim-equal '("ゴ" "ゴ" "ジャ" "ジャ")
1072
'(append-map-ustr-latter cdr ustrj-fl))
1073
(assert-uim-equal '()
1074
'(append-map-ustr-latter cdr ustrj-f))
1075
(assert-uim-equal '("ニ" "ニ" "ホ" "ホ" "ン" "ン" "ゴ" "ゴ" "ジャ" "ジャ")
1076
'(append-map-ustr-latter cdr ustrj-l))
1077
(assert-uim-equal '()
1078
'(append-map-ustr-latter cdr ustre)))
1080
(define (test-string-append-map-ustr-whole)
1082
(assert-uim-equal "hello"
1083
'(string-append-map-ustr-whole car ustr-fl))
1084
(assert-uim-equal "HELLO"
1085
'(string-append-map-ustr-whole cdr ustr-fl))
1086
(assert-uim-equal "にほんごじゃ"
1087
(uim '(string-append-map-ustr-whole ja-kana-hiragana
1089
(assert-uim-equal "ニホンゴジャ"
1090
(uim '(string-append-map-ustr-whole ja-kana-katakana
1092
(assert-uim-equal "ニホンゴジャ"
1093
(uim '(string-append-map-ustr-whole ja-kana-hankaku
1096
(assert-uim-equal "hello"
1097
'(string-append-map-ustr-whole car ustr-f))
1098
(assert-uim-equal "HELLO"
1099
'(string-append-map-ustr-whole cdr ustr-f))
1100
(assert-uim-equal "にほんごじゃ"
1101
(uim '(string-append-map-ustr-whole ja-kana-hiragana
1103
(assert-uim-equal "ニホンゴジャ"
1104
(uim '(string-append-map-ustr-whole ja-kana-katakana
1106
(assert-uim-equal "ニホンゴジャ"
1107
(uim '(string-append-map-ustr-whole ja-kana-hankaku
1110
(assert-uim-equal "hello"
1111
'(string-append-map-ustr-whole car ustr-l))
1112
(assert-uim-equal "HELLO"
1113
'(string-append-map-ustr-whole cdr ustr-l))
1114
(assert-uim-equal "にほんごじゃ"
1115
(uim '(string-append-map-ustr-whole ja-kana-hiragana
1117
(assert-uim-equal "ニホンゴジャ"
1118
(uim '(string-append-map-ustr-whole ja-kana-katakana
1120
(assert-uim-equal "ニホンゴジャ"
1121
(uim '(string-append-map-ustr-whole ja-kana-hankaku
1124
(assert-uim-equal ""
1125
'(string-append-map-ustr-whole cdr ustre)))
1127
(define (test-string-append-map-ustr-former)
1129
(assert-uim-equal "hel"
1130
'(string-append-map-ustr-former car ustr-fl))
1131
(assert-uim-equal "HEL"
1132
'(string-append-map-ustr-former cdr ustr-fl))
1133
(assert-uim-equal "にほん"
1134
(uim '(string-append-map-ustr-former ja-kana-hiragana
1136
(assert-uim-equal "ニホン"
1137
(uim '(string-append-map-ustr-former ja-kana-katakana
1139
(assert-uim-equal "ニホン"
1140
(uim '(string-append-map-ustr-former ja-kana-hankaku
1143
(assert-uim-equal "hello"
1144
'(string-append-map-ustr-former car ustr-f))
1145
(assert-uim-equal "HELLO"
1146
'(string-append-map-ustr-former cdr ustr-f))
1147
(assert-uim-equal "にほんごじゃ"
1148
(uim '(string-append-map-ustr-former ja-kana-hiragana
1150
(assert-uim-equal "ニホンゴジャ"
1151
(uim '(string-append-map-ustr-former ja-kana-katakana
1153
(assert-uim-equal "ニホンゴジャ"
1154
(uim '(string-append-map-ustr-former ja-kana-hankaku
1157
(assert-uim-equal ""
1158
'(string-append-map-ustr-former car ustr-l))
1159
(assert-uim-equal ""
1160
'(string-append-map-ustr-former cdr ustr-l))
1161
(assert-uim-equal ""
1162
(uim '(string-append-map-ustr-former ja-kana-hiragana
1164
(assert-uim-equal ""
1165
(uim '(string-append-map-ustr-former ja-kana-katakana
1167
(assert-uim-equal ""
1168
(uim '(string-append-map-ustr-former ja-kana-hankaku
1171
(assert-uim-equal ""
1172
'(string-append-map-ustr-former cdr ustre)))
1174
(define (test-string-append-map-ustr-latter)
1176
(assert-uim-equal "lo"
1177
'(string-append-map-ustr-latter car ustr-fl))
1178
(assert-uim-equal "LO"
1179
'(string-append-map-ustr-latter cdr ustr-fl))
1180
(assert-uim-equal "ごじゃ"
1181
(uim '(string-append-map-ustr-latter ja-kana-hiragana
1183
(assert-uim-equal "ゴジャ"
1184
(uim '(string-append-map-ustr-latter ja-kana-katakana
1186
(assert-uim-equal "ゴジャ"
1187
(uim '(string-append-map-ustr-latter ja-kana-hankaku
1190
(assert-uim-equal ""
1191
'(string-append-map-ustr-latter car ustr-f))
1192
(assert-uim-equal ""
1193
'(string-append-map-ustr-latter cdr ustr-f))
1194
(assert-uim-equal ""
1195
(uim '(string-append-map-ustr-latter ja-kana-hiragana
1197
(assert-uim-equal ""
1198
(uim '(string-append-map-ustr-latter ja-kana-katakana
1200
(assert-uim-equal ""
1201
(uim '(string-append-map-ustr-latter ja-kana-hankaku
1204
(assert-uim-equal "hello"
1205
'(string-append-map-ustr-latter car ustr-l))
1206
(assert-uim-equal "HELLO"
1207
'(string-append-map-ustr-latter cdr ustr-l))
1208
(assert-uim-equal "にほんごじゃ"
1209
(uim '(string-append-map-ustr-latter ja-kana-hiragana
1211
(assert-uim-equal "ニホンゴジャ"
1212
(uim '(string-append-map-ustr-latter ja-kana-katakana
1214
(assert-uim-equal "ニホンゴジャ"
1215
(uim '(string-append-map-ustr-latter ja-kana-hankaku
1218
(assert-uim-equal ""
1219
'(string-append-map-ustr-latter cdr ustre)))
1221
(define (test-ustr-cursor-at-beginning?)
1222
(assert-uim-false '(ustr-cursor-at-beginning? ustra-fl))
1223
(assert-uim-false '(ustr-cursor-at-beginning? ustra-f))
1224
(assert-uim-true '(ustr-cursor-at-beginning? ustra-l))
1225
(assert-uim-true '(ustr-cursor-at-beginning? ustre)))
1227
(define (test-ustr-cursor-at-end?)
1228
(assert-uim-false '(ustr-cursor-at-end? ustra-fl))
1229
(assert-uim-true '(ustr-cursor-at-end? ustra-f))
1230
(assert-uim-false '(ustr-cursor-at-end? ustra-l))
1231
(assert-uim-true '(ustr-cursor-at-end? ustre)))
1233
(define (test-ustr-cursor-pos)
1235
'(ustr-cursor-pos ustr-fl))
1237
'(ustr-cursor-pos ustr-f))
1239
'(ustr-cursor-pos ustr-l))
1242
'(ustr-cursor-pos ustrj-fl))
1244
'(ustr-cursor-pos ustrj-f))
1246
'(ustr-cursor-pos ustrj-l))
1249
'(ustr-cursor-pos ustra-fl))
1251
'(ustr-cursor-pos ustra-f))
1253
'(ustr-cursor-pos ustra-l))
1256
'(ustr-cursor-pos ustre)))
1258
(define (test-ustr-set-cursor-pos!)
1261
'(ustr-cursor-pos ustra-fl))
1262
(assert-uim-true '(ustr-set-cursor-pos! ustra-fl 0))
1264
'(ustr-cursor-pos ustra-fl))
1265
(assert-uim-true '(ustr-set-cursor-pos! ustra-fl 5))
1267
'(ustr-cursor-pos ustra-fl))
1268
(assert-uim-true '(ustr-set-cursor-pos! ustra-fl 2))
1270
'(ustr-cursor-pos ustra-fl))
1271
(assert-uim-false '(ustr-set-cursor-pos! ustra-fl -1))
1272
(assert-uim-false '(ustr-set-cursor-pos! ustra-fl 6))
1275
'(ustr-cursor-pos ustre))
1276
(assert-uim-true '(ustr-set-cursor-pos! ustra-fl 0))
1278
'(ustr-cursor-pos ustre))
1279
(assert-uim-false '(ustr-set-cursor-pos! ustre -1))
1280
(assert-uim-false '(ustr-set-cursor-pos! ustre 1)))
1282
(define (test-ustr-cursor-move!)
1284
'(ustr-cursor-pos ustra-fl))
1285
(assert-uim-false '(ustr-cursor-move! ustra-fl -4))
1287
'(ustr-cursor-pos ustra-fl))
1289
(assert-uim-false '(ustr-cursor-move! ustra-fl 3))
1291
'(ustr-cursor-pos ustra-fl))
1293
(assert-uim-true '(ustr-cursor-move! ustra-fl 2))
1295
'(ustr-cursor-pos ustra-fl))
1297
(assert-uim-true '(ustr-cursor-move! ustra-fl -3))
1299
'(ustr-cursor-pos ustra-fl))
1301
(assert-uim-true '(ustr-cursor-move! ustra-fl 1))
1303
'(ustr-cursor-pos ustra-fl))
1305
(assert-uim-true '(ustr-cursor-move! ustra-fl 0))
1307
'(ustr-cursor-pos ustra-fl))
1309
(assert-uim-true '(ustr-cursor-move! ustra-fl -3))
1311
'(ustr-cursor-pos ustra-fl))
1314
'(ustr-cursor-pos ustre))
1315
(assert-uim-true '(ustr-cursor-move! ustra-fl 0))
1317
'(ustr-cursor-pos ustre))
1319
(assert-uim-false '(ustr-cursor-move! ustre -1))
1320
(assert-uim-false '(ustr-cursor-move! ustre 1)))
1322
(define (test-ustr-cursor-move-backward!)
1324
'(ustr-cursor-pos ustra-fl))
1326
(uim-eval '(ustr-cursor-move-backward! ustra-fl))
1328
'(ustr-cursor-pos ustra-fl))
1330
(uim-eval '(ustr-cursor-move-backward! ustra-fl))
1332
'(ustr-cursor-pos ustra-fl))
1334
(uim-eval '(ustr-cursor-move-backward! ustra-fl))
1336
'(ustr-cursor-pos ustra-fl))
1338
(uim-eval '(ustr-cursor-move-backward! ustra-fl))
1340
'(ustr-cursor-pos ustra-fl))
1341
;; start from end of string
1343
'(ustr-cursor-pos ustra-f))
1344
(uim-eval '(ustr-cursor-move-backward! ustra-f))
1346
'(ustr-cursor-pos ustra-f)))
1348
(define (test-ustr-cursor-move-forward!)
1350
'(ustr-cursor-pos ustra-fl))
1352
(uim-eval '(ustr-cursor-move-forward! ustra-fl))
1354
'(ustr-cursor-pos ustra-fl))
1356
(uim-eval '(ustr-cursor-move-forward! ustra-fl))
1358
'(ustr-cursor-pos ustra-fl))
1360
(uim-eval '(ustr-cursor-move-forward! ustra-fl))
1362
'(ustr-cursor-pos ustra-fl))
1364
;; start from beginning of string
1366
'(ustr-cursor-pos ustra-l))
1367
(uim-eval '(ustr-cursor-move-forward! ustra-l))
1369
'(ustr-cursor-pos ustra-l)))
1371
(define (test-ustr-cursor-move-beginning!)
1373
'(ustr-cursor-pos ustra-fl))
1375
(uim-eval '(ustr-cursor-move-beginning! ustra-fl))
1377
'(ustr-cursor-pos ustra-fl))
1379
(uim-eval '(ustr-cursor-move-beginning! ustra-fl))
1381
'(ustr-cursor-pos ustra-fl))
1383
;; start from end of string
1385
'(ustr-cursor-pos ustra-f))
1386
(uim-eval '(ustr-cursor-move-beginning! ustra-f))
1388
'(ustr-cursor-pos ustra-f)))
1390
(define (test-ustr-cursor-move-end!)
1392
'(ustr-cursor-pos ustra-fl))
1394
(uim-eval '(ustr-cursor-move-end! ustra-fl))
1396
'(ustr-cursor-pos ustra-fl))
1398
(uim-eval '(ustr-cursor-move-end! ustra-fl))
1400
'(ustr-cursor-pos ustra-fl))
1402
;; start from beginning of string
1404
'(ustr-cursor-pos ustra-l))
1405
(uim-eval '(ustr-cursor-move-end! ustra-l))
1407
'(ustr-cursor-pos ustra-l)))
1409
(define (test-ustr-cursor-frontside)
1411
(assert-uim-equal '("l" . "L")
1412
'(ustr-cursor-frontside ustr-fl))
1413
(assert-uim-equal '("ご" "ゴ" "ゴ")
1414
'(ustr-cursor-frontside ustrj-fl))
1415
(assert-uim-equal "l"
1416
'(ustr-cursor-frontside ustra-fl))
1418
(assert-uim-error '(ustr-cursor-frontside ustr-f))
1419
(assert-uim-error '(ustr-cursor-frontside ustrj-f))
1420
(assert-uim-error '(ustr-cursor-frontside ustra-f))
1422
(assert-uim-equal '("h" . "H")
1423
'(ustr-cursor-frontside ustr-l))
1424
(assert-uim-equal '("に" "ニ" "ニ")
1425
'(ustr-cursor-frontside ustrj-l))
1426
(assert-uim-equal "h"
1427
'(ustr-cursor-frontside ustra-l))
1429
(assert-uim-error '(ustr-cursor-frontside ustre)))
1431
(define (test-ustr-cursor-backside)
1433
(assert-uim-equal '("l" . "L")
1434
'(ustr-cursor-backside ustr-fl))
1435
(assert-uim-equal '("ん" "ン" "ン")
1436
'(ustr-cursor-backside ustrj-fl))
1437
(assert-uim-equal "l"
1438
'(ustr-cursor-backside ustra-fl))
1440
(assert-uim-equal '("o" . "O")
1441
'(ustr-cursor-backside ustr-f))
1442
(assert-uim-equal '("じゃ" "ジャ" "ジャ")
1443
'(ustr-cursor-backside ustrj-f))
1444
(assert-uim-equal "o"
1445
'(ustr-cursor-backside ustra-f))
1447
(assert-uim-error '(ustr-cursor-backside ustr-l))
1448
(assert-uim-error '(ustr-cursor-backside ustrj-l))
1449
(assert-uim-error '(ustr-cursor-backside ustra-l))
1451
(assert-uim-error '(ustr-cursor-backside ustre)))
1453
(define (test-ustr-cursor-delete-frontside!)
1455
(assert-uim-equal '("ご" "ゴ" "ゴ")
1456
'(ustr-cursor-frontside ustrj-fl))
1458
'(ustr-length ustrj-fl))
1460
'(ustr-cursor-pos ustrj-fl))
1461
(assert-uim-true '(ustr-cursor-delete-frontside! ustrj-fl))
1462
(assert-uim-equal '("じゃ" "ジャ" "ジャ")
1463
'(ustr-cursor-frontside ustrj-fl))
1465
'(ustr-length ustrj-fl))
1467
'(ustr-cursor-pos ustrj-fl))
1468
(assert-uim-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
1470
'(ustr-whole-seq ustrj-fl))
1472
(assert-uim-error '(ustr-cursor-frontside ustrj-f))
1474
'(ustr-length ustrj-f))
1476
'(ustr-cursor-pos ustrj-f))
1477
(assert-uim-false '(ustr-cursor-delete-frontside! ustrj-f))
1478
(assert-uim-error '(ustr-cursor-frontside ustrj-f))
1480
'(ustr-length ustrj-f))
1482
'(ustr-cursor-pos ustrj-f))
1483
(assert-uim-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
1484
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
1485
'(ustr-whole-seq ustrj-f))
1487
(assert-uim-equal '("に" "ニ" "ニ")
1488
'(ustr-cursor-frontside ustrj-l))
1490
'(ustr-length ustrj-l))
1492
'(ustr-cursor-pos ustrj-l))
1493
(assert-uim-true '(ustr-cursor-delete-frontside! ustrj-l))
1494
(assert-uim-equal '("ほ" "ホ" "ホ")
1495
'(ustr-cursor-frontside ustrj-l))
1497
'(ustr-length ustrj-l))
1499
'(ustr-cursor-pos ustrj-l))
1500
(assert-uim-equal '(("ほ" "ホ" "ホ") ("ん" "ン" "ン")
1501
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
1502
'(ustr-whole-seq ustrj-l))
1504
(assert-uim-error '(ustr-cursor-frontside ustre))
1506
'(ustr-length ustre))
1508
'(ustr-cursor-pos ustre))
1509
(assert-uim-false '(ustr-cursor-delete-frontside! ustre))
1510
(assert-uim-error '(ustr-cursor-frontside ustre))
1512
'(ustr-length ustre))
1514
'(ustr-cursor-pos ustre)))
1516
(define (test-ustr-cursor-delete-backside!)
1518
(assert-uim-equal '("ん" "ン" "ン")
1519
'(ustr-cursor-backside ustrj-fl))
1521
'(ustr-length ustrj-fl))
1523
'(ustr-cursor-pos ustrj-fl))
1524
(assert-uim-true '(ustr-cursor-delete-backside! ustrj-fl))
1525
(assert-uim-equal '("ほ" "ホ" "ホ")
1526
'(ustr-cursor-backside ustrj-fl))
1528
'(ustr-length ustrj-fl))
1530
'(ustr-cursor-pos ustrj-fl))
1531
(assert-uim-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ")
1532
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
1533
'(ustr-whole-seq ustrj-fl))
1535
(assert-uim-equal '("じゃ" "ジャ" "ジャ")
1536
'(ustr-cursor-backside ustrj-f))
1538
'(ustr-length ustrj-f))
1540
'(ustr-cursor-pos ustrj-f))
1541
(assert-uim-true '(ustr-cursor-delete-backside! ustrj-f))
1542
(assert-uim-equal '("ご" "ゴ" "ゴ")
1543
'(ustr-cursor-backside ustrj-f))
1545
'(ustr-length ustrj-f))
1547
'(ustr-cursor-pos ustrj-f))
1548
(assert-uim-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
1550
'(ustr-whole-seq ustrj-f))
1552
(assert-uim-error '(ustr-cursor-backside ustrj-l))
1554
'(ustr-length ustrj-l))
1556
'(ustr-cursor-pos ustrj-l))
1557
(assert-uim-false '(ustr-cursor-delete-backside! ustrj-l))
1558
(assert-uim-error '(ustr-cursor-backside ustrj-l))
1560
'(ustr-length ustrj-l))
1562
'(ustr-cursor-pos ustrj-l))
1563
(assert-uim-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
1564
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
1565
'(ustr-whole-seq ustrj-l))
1567
(assert-uim-error '(ustr-cursor-backside ustre))
1569
'(ustr-length ustre))
1570
(assert-uim-false '(ustr-cursor-delete-backside! ustre))
1571
(assert-uim-error '(ustr-cursor-backside ustre))
1573
'(ustr-length ustre)))
1575
(define (test-ustr-insert-elem!)
1577
(assert-uim-equal '("ん" "ン" "ン")
1578
'(ustr-cursor-backside ustrj-fl))
1580
'(ustr-length ustrj-fl))
1582
'(ustr-cursor-pos ustrj-fl))
1583
(uim-eval '(ustr-insert-elem! ustrj-fl '("んー" "ンー" "ンー")))
1584
(assert-uim-equal '("んー" "ンー" "ンー")
1585
'(ustr-cursor-backside ustrj-fl))
1587
'(ustr-length ustrj-fl))
1589
'(ustr-cursor-pos ustrj-fl))
1590
(assert-uim-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
1592
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
1593
'(ustr-whole-seq ustrj-fl))
1595
(assert-uim-equal '("じゃ" "ジャ" "ジャ")
1596
'(ustr-cursor-backside ustrj-f))
1598
'(ustr-length ustrj-f))
1600
'(ustr-cursor-pos ustrj-f))
1601
(uim-eval '(ustr-insert-elem! ustrj-f '("んー" "ンー" "ンー")))
1602
(assert-uim-equal '("んー" "ンー" "ンー")
1603
'(ustr-cursor-backside ustrj-f))
1605
'(ustr-length ustrj-f))
1607
'(ustr-cursor-pos ustrj-f))
1608
(assert-uim-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
1609
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ") ("んー" "ンー" "ンー"))
1610
'(ustr-whole-seq ustrj-f))
1612
(assert-uim-error '(ustr-cursor-backside ustrj-l))
1614
'(ustr-length ustrj-l))
1616
'(ustr-cursor-pos ustrj-l))
1617
(uim-eval '(ustr-insert-elem! ustrj-l '("んー" "ンー" "ンー")))
1618
(assert-uim-equal '("んー" "ンー" "ンー")
1619
'(ustr-cursor-backside ustrj-l))
1621
'(ustr-length ustrj-l))
1623
'(ustr-cursor-pos ustrj-l))
1624
(assert-uim-equal '(("んー" "ンー" "ンー")
1625
("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
1626
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
1627
'(ustr-whole-seq ustrj-l))
1629
(assert-uim-error '(ustr-cursor-backside ustre))
1631
'(ustr-length ustre))
1632
(uim-eval '(ustr-insert-elem! ustre '("んー" "ンー" "ンー")))
1633
(assert-uim-equal '("んー" "ンー" "ンー")
1634
'(ustr-cursor-backside ustre))
1636
'(ustr-length ustre))
1637
(assert-uim-equal '(("んー" "ンー" "ンー"))
1638
'(ustr-whole-seq ustre)))
1640
(define (test-ustr-cursor-set-frontside!)
1642
(assert-uim-equal '("ご" "ゴ" "ゴ")
1643
'(ustr-cursor-frontside ustrj-fl))
1645
'(ustr-length ustrj-fl))
1647
'(ustr-cursor-pos ustrj-fl))
1648
(assert-true (uim-bool '(ustr-cursor-set-frontside! ustrj-fl
1649
'("んー" "ンー" "ンー"))))
1650
(assert-uim-equal '("んー" "ンー" "ンー")
1651
'(ustr-cursor-frontside ustrj-fl))
1653
'(ustr-length ustrj-fl))
1655
'(ustr-cursor-pos ustrj-fl))
1656
(assert-uim-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
1657
("んー" "ンー" "ンー") ("じゃ" "ジャ" "ジャ"))
1658
'(ustr-whole-seq ustrj-fl))
1660
(assert-uim-error '(ustr-cursor-frontside ustrj-f))
1662
'(ustr-length ustrj-f))
1664
'(ustr-cursor-pos ustrj-f))
1665
(assert-false (uim-bool '(ustr-cursor-set-frontside! ustrj-f
1666
'("んー" "ンー" "ンー"))))
1668
'(ustr-length ustrj-f))
1670
'(ustr-cursor-pos ustrj-f))
1671
(assert-uim-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
1672
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
1673
'(ustr-whole-seq ustrj-f))
1675
(assert-uim-equal '("に" "ニ" "ニ")
1676
'(ustr-cursor-frontside ustrj-l))
1678
'(ustr-length ustrj-l))
1680
'(ustr-cursor-pos ustrj-l))
1681
(assert-true (uim-bool '(ustr-cursor-set-frontside! ustrj-l
1682
'("んー" "ンー" "ンー"))))
1683
(assert-uim-equal '("んー" "ンー" "ンー")
1684
'(ustr-cursor-frontside ustrj-l))
1686
'(ustr-length ustrj-l))
1688
'(ustr-cursor-pos ustrj-l))
1689
(assert-uim-equal '(("んー" "ンー" "ンー") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
1690
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
1691
'(ustr-whole-seq ustrj-l))
1693
(assert-uim-error '(ustr-cursor-frontside ustre))
1695
'(ustr-length ustre))
1696
(assert-false (uim-bool '(ustr-cursor-set-frontside! ustre
1697
'("んー" "ンー" "ンー"))))
1698
(assert-uim-error '(ustr-cursor-frontside ustre))
1700
'(ustr-length ustre))
1701
(assert-uim-equal '()
1702
'(ustr-whole-seq ustre)))
1704
(define (test-ustr-cursor-set-backside!)
1706
(assert-uim-equal '("ん" "ン" "ン")
1707
'(ustr-cursor-backside ustrj-fl))
1709
'(ustr-length ustrj-fl))
1711
'(ustr-cursor-pos ustrj-fl))
1712
(assert-true (uim-bool '(ustr-cursor-set-backside! ustrj-fl
1713
'("んー" "ンー" "ンー"))))
1714
(assert-uim-equal '("んー" "ンー" "ンー")
1715
'(ustr-cursor-backside ustrj-fl))
1717
'(ustr-length ustrj-fl))
1719
'(ustr-cursor-pos ustrj-fl))
1720
(assert-uim-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("んー" "ンー" "ンー")
1721
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
1722
'(ustr-whole-seq ustrj-fl))
1724
(assert-uim-equal '("じゃ" "ジャ" "ジャ")
1725
'(ustr-cursor-backside ustrj-f))
1727
'(ustr-length ustrj-f))
1729
'(ustr-cursor-pos ustrj-f))
1730
(assert-true (uim-bool '(ustr-cursor-set-backside! ustrj-f
1731
'("んー" "ンー" "ンー"))))
1732
(assert-uim-equal '("んー" "ンー" "ンー")
1733
'(ustr-cursor-backside ustrj-f))
1735
'(ustr-length ustrj-f))
1737
'(ustr-cursor-pos ustrj-f))
1738
(assert-uim-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
1739
("ご" "ゴ" "ゴ") ("んー" "ンー" "ンー"))
1740
'(ustr-whole-seq ustrj-f))
1742
(assert-uim-error '(ustr-cursor-backside ustrj-l))
1744
'(ustr-length ustrj-l))
1746
'(ustr-cursor-pos ustrj-l))
1747
(assert-false (uim-bool '(ustr-cursor-set-backside! ustrj-l
1748
'("んー" "ンー" "ンー"))))
1749
(assert-uim-error '(ustr-cursor-backside ustrj-l))
1751
'(ustr-length ustrj-l))
1753
'(ustr-cursor-pos ustrj-l))
1754
(assert-uim-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
1755
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
1756
'(ustr-whole-seq ustrj-l))
1758
(assert-uim-error '(ustr-cursor-backside ustre))
1760
'(ustr-length ustre))
1761
(assert-false (uim-bool '(ustr-cursor-set-backside! ustre
1762
'("んー" "ンー" "ンー"))))
1763
(assert-uim-error '(ustr-cursor-backside ustre))
1765
'(ustr-length ustre))
1766
(assert-uim-equal '()
1767
'(ustr-whole-seq ustre)))
1769
(define (test-ustr-insert-seq!)
1771
(assert-uim-equal '("ん" "ン" "ン")
1772
'(ustr-cursor-backside ustrj-fl))
1774
'(ustr-length ustrj-fl))
1776
'(ustr-cursor-pos ustrj-fl))
1777
(uim-eval '(ustr-insert-seq! ustrj-fl '(("んー" "ンー" "ンー") ("か" "カ" "カ")
1779
(assert-uim-equal '("よ" "ヨ" "ヨ")
1780
'(ustr-cursor-backside ustrj-fl))
1782
'(ustr-length ustrj-fl))
1784
'(ustr-cursor-pos ustrj-fl))
1785
(assert-uim-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
1786
("んー" "ンー" "ンー") ("か" "カ" "カ") ("よ" "ヨ" "ヨ")
1787
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
1788
'(ustr-whole-seq ustrj-fl))
1790
(assert-uim-equal '("じゃ" "ジャ" "ジャ")
1791
'(ustr-cursor-backside ustrj-f))
1793
'(ustr-length ustrj-f))
1795
'(ustr-cursor-pos ustrj-f))
1796
(uim-eval '(ustr-insert-seq! ustrj-f '(("んー" "ンー" "ンー") ("か" "カ" "カ")
1798
(assert-uim-equal '("よ" "ヨ" "ヨ")
1799
'(ustr-cursor-backside ustrj-f))
1801
'(ustr-length ustrj-f))
1803
'(ustr-cursor-pos ustrj-f))
1804
(assert-uim-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
1805
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ")
1806
("んー" "ンー" "ンー") ("か" "カ" "カ") ("よ" "ヨ" "ヨ"))
1807
'(ustr-whole-seq ustrj-f))
1809
(assert-uim-error '(ustr-cursor-backside ustrj-l))
1811
'(ustr-length ustrj-l))
1813
'(ustr-cursor-pos ustrj-l))
1814
(uim-eval '(ustr-insert-seq! ustrj-l '(("んー" "ンー" "ンー") ("か" "カ" "カ")
1816
(assert-uim-equal '("よ" "ヨ" "ヨ")
1817
'(ustr-cursor-backside ustrj-l))
1819
'(ustr-length ustrj-l))
1821
'(ustr-cursor-pos ustrj-l))
1822
(assert-uim-equal '(("んー" "ンー" "ンー") ("か" "カ" "カ") ("よ" "ヨ" "ヨ")
1823
("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
1824
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
1825
'(ustr-whole-seq ustrj-l))
1827
(assert-uim-error '(ustr-cursor-backside ustre))
1829
'(ustr-length ustre))
1831
'(ustr-cursor-pos ustre))
1832
(uim-eval '(ustr-insert-seq! ustre '(("んー" "ンー" "ンー") ("か" "カ" "カ")
1834
(assert-uim-equal '("よ" "ヨ" "ヨ")
1835
'(ustr-cursor-backside ustre))
1837
'(ustr-length ustre))
1839
'(ustr-cursor-pos ustre))
1840
(assert-uim-equal '(("んー" "ンー" "ンー") ("か" "カ" "カ") ("よ" "ヨ" "ヨ"))
1841
'(ustr-whole-seq ustre)))
1843
(define (test-ustr-insert-seq!-#2)
1845
(assert-uim-equal '("ん" "ン" "ン")
1846
'(ustr-cursor-backside ustrj-fl))
1848
'(ustr-length ustrj-fl))
1850
'(ustr-cursor-pos ustrj-fl))
1851
(uim-eval '(ustr-insert-seq! ustrj-fl ()))
1852
(assert-uim-equal '("ん" "ン" "ン")
1853
'(ustr-cursor-backside ustrj-fl))
1855
'(ustr-length ustrj-fl))
1857
'(ustr-cursor-pos ustrj-fl))
1858
(assert-uim-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
1859
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
1860
'(ustr-whole-seq ustrj-fl))
1862
(assert-uim-equal '("じゃ" "ジャ" "ジャ")
1863
'(ustr-cursor-backside ustrj-f))
1865
'(ustr-length ustrj-f))
1867
'(ustr-cursor-pos ustrj-f))
1868
(uim-eval '(ustr-insert-seq! ustrj-f ()))
1869
(assert-uim-equal '("じゃ" "ジャ" "ジャ")
1870
'(ustr-cursor-backside ustrj-f))
1872
'(ustr-length ustrj-f))
1874
'(ustr-cursor-pos ustrj-f))
1875
(assert-uim-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
1876
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
1877
'(ustr-whole-seq ustrj-f))
1879
(assert-uim-error '(ustr-cursor-backside ustrj-l))
1881
'(ustr-length ustrj-l))
1883
'(ustr-cursor-pos ustrj-l))
1884
(uim-eval '(ustr-insert-seq! ustrj-l ()))
1885
(assert-uim-error '(ustr-cursor-backside ustrj-l))
1887
'(ustr-length ustrj-l))
1889
'(ustr-cursor-pos ustrj-l))
1890
(assert-uim-equal '(("に" "ニ" "ニ") ("ほ" "ホ" "ホ") ("ん" "ン" "ン")
1891
("ご" "ゴ" "ゴ") ("じゃ" "ジャ" "ジャ"))
1892
'(ustr-whole-seq ustrj-l))
1894
(assert-uim-error '(ustr-cursor-backside ustre))
1896
'(ustr-length ustre))
1898
'(ustr-cursor-pos ustre))
1899
(uim-eval '(ustr-insert-seq! ustre ()))
1900
(assert-uim-error '(ustr-cursor-backside ustre))
1902
'(ustr-length ustre))
1904
'(ustr-cursor-pos ustre)))
1906
(provide "test/test-ustr")