7016
|
1 ## Copyright (C) 2007 John W. Eaton |
|
2 ## |
|
3 ## This file is part of Octave. |
|
4 ## |
|
5 ## Octave is free software; you can redistribute it and/or modify it |
|
6 ## under the terms of the GNU General Public License as published by |
|
7 ## the Free Software Foundation; either version 3 of the License, or (at |
|
8 ## your option) any later version. |
|
9 ## |
|
10 ## Octave is distributed in the hope that it will be useful, but |
|
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
13 ## General Public License for more details. |
|
14 ## |
|
15 ## You should have received a copy of the GNU General Public License |
|
16 ## along with Octave; see the file COPYING. If not, see |
|
17 ## <http://www.gnu.org/licenses/>. |
|
18 |
5590
|
19 %% Automatically generated from DejaGNU files |
|
20 |
|
21 %% test/octave.test/string/str-esc-1.m |
|
22 %!test |
|
23 %! x = 7; |
|
24 %! if (strcmp ("\a", setstr (x))) |
|
25 %! printf_assert ("ok\n"); |
|
26 %! endif |
|
27 %! assert(prog_output_assert("ok")); |
|
28 |
|
29 %% test/octave.test/string/str-esc-2.m |
|
30 %!test |
|
31 %! x = 8; |
|
32 %! if (strcmp ("\b", setstr (x))) |
|
33 %! printf_assert ("ok\n"); |
|
34 %! endif |
|
35 %! assert(prog_output_assert("ok")); |
|
36 |
|
37 %% test/octave.test/string/str-esc-3.m |
|
38 %!test |
|
39 %! x = 12; |
|
40 %! if (strcmp ("\f", setstr (x))) |
|
41 %! printf_assert ("ok\n"); |
|
42 %! endif |
|
43 %! assert(prog_output_assert("ok")); |
|
44 |
|
45 %% test/octave.test/string/str-esc-4.m |
|
46 %!test |
|
47 %! x = 10; |
|
48 %! if (strcmp ("\n", setstr (x))) |
|
49 %! printf_assert ("ok\n"); |
|
50 %! endif |
|
51 %! assert(prog_output_assert("ok")); |
|
52 |
|
53 %% test/octave.test/string/str-esc-5.m |
|
54 %!test |
|
55 %! x = 13; |
|
56 %! if (strcmp ("\r", setstr (x))) |
|
57 %! printf_assert ("ok\n"); |
|
58 %! endif |
|
59 %! assert(prog_output_assert("ok")); |
|
60 |
|
61 %% test/octave.test/string/str-esc-6.m |
|
62 %!test |
|
63 %! x = 9; |
|
64 %! if (strcmp ("\t", setstr (x))) |
|
65 %! printf_assert ("ok\n"); |
|
66 %! endif |
|
67 %! assert(prog_output_assert("ok")); |
|
68 |
|
69 %% test/octave.test/string/str-esc-7.m |
|
70 %!test |
|
71 %! x = 11; |
|
72 %! if (strcmp ("\v", setstr (x))) |
|
73 %! printf_assert ("ok\n"); |
|
74 %! endif |
|
75 %! assert(prog_output_assert("ok")); |
|
76 |
|
77 %% test/octave.test/string/str-esc-8.m |
|
78 %!test |
|
79 %! x = 92; |
|
80 %! if (strcmp ("\\", setstr (x))) |
|
81 %! printf_assert ("ok\n"); |
|
82 %! endif |
|
83 %! assert(prog_output_assert("ok")); |
|
84 |
|
85 %% test/octave.test/string/str-esc-9.m |
|
86 %!test |
|
87 %! x = 39; |
|
88 %! if (strcmp ("\'", setstr (x))) |
|
89 %! printf_assert ("ok\n"); |
|
90 %! endif |
|
91 %! assert(prog_output_assert("ok")); |
|
92 |
|
93 %% test/octave.test/string/str-esc-10.m |
|
94 %!test |
|
95 %! x = 34; |
|
96 %! if (strcmp ("\"", setstr (x))) |
|
97 %! printf_assert ("ok\n"); |
|
98 %! endif |
|
99 %! assert(prog_output_assert("ok")); |
|
100 |
|
101 %% test/octave.test/string/str-esc-11.m |
|
102 %!test |
|
103 %! x = 120; |
|
104 %! fail('strcmp ("\x", setstr (x))',"warning",".*unrecognized escape sequence.*"); |
|
105 |
|
106 %% test/octave.test/string/str-esc-12.m |
|
107 %!test |
|
108 %! x = [7, 8, 12, 10, 13, 9, 11, 92, 39, 34]; |
|
109 %! if (strcmp ("\a\b\f\n\r\t\v\\\'\"", setstr (x))) |
|
110 %! printf_assert ("ok\n"); |
|
111 %! endif |
|
112 %! assert(prog_output_assert("ok")); |
|
113 |
5775
|
114 %% FIXME |
5590
|
115 %% Why do the next two tests fail? |
|
116 %% test/octave.test/string/string_fill_char-1.m |
|
117 %!#test |
|
118 %! sfc = string_fill_char; |
|
119 %! string_fill_char = "X"; |
|
120 %! str = ["these"; "are"; "strings"]; |
|
121 %! assert(str,["theseXX"; "areXXXX"; "strings"]); |
|
122 %! string_fill_char = sfc; |
|
123 |
|
124 %% test/octave.test/string/string_fill_char-2.m |
|
125 %!#test |
|
126 %! sfc = string_fill_char; |
|
127 %! string_fill_char = " "; |
|
128 %! str = ["these"; "are"; "strings"]; |
|
129 %! assert(str,["these "; "are "; "strings"]); |
|
130 %! string_fill_char = sfc; |
|
131 |
|
132 %% test/octave.test/string/ischar-1.m |
|
133 %!assert(!(ischar (1))); |
|
134 |
|
135 %% test/octave.test/string/ischar-2.m |
|
136 %!assert(!(ischar ([1, 2]))); |
|
137 |
|
138 %% test/octave.test/string/ischar-3.m |
|
139 %!assert(!(ischar ([]))); |
|
140 |
|
141 %% test/octave.test/string/ischar-4.m |
|
142 %!assert(!(ischar ([1, 2; 3, 4]))); |
|
143 |
|
144 %% test/octave.test/string/ischar-5.m |
|
145 %!assert(ischar ("")); |
|
146 |
|
147 %% test/octave.test/string/ischar-6.m |
|
148 %!assert(ischar ("t")); |
|
149 |
|
150 %% test/octave.test/string/ischar-7.m |
|
151 %!assert(ischar ("test")); |
|
152 |
|
153 %% test/octave.test/string/ischar-8.m |
|
154 %!assert(ischar (["test"; "ing"])); |
|
155 |
|
156 %% test/octave.test/string/ischar-9.m |
|
157 %!test |
|
158 %! s.a = "test"; |
|
159 %! assert(!(ischar (s))); |
|
160 |
|
161 %% test/octave.test/string/ischar-10.m |
5751
|
162 %!error <Invalid call to ischar.*> ischar (); |
5590
|
163 |
|
164 %% test/octave.test/string/ischar-11.m |
5751
|
165 %!error <Invalid call to ischar.*> ischar ("test", 1); |
5590
|
166 |
|
167 %% test/octave.test/string/blanks-1.m |
|
168 %!assert(strcmp (blanks (3), " ")); |
|
169 |
|
170 %% test/octave.test/string/blanks-2.m |
|
171 %!error blanks (); |
|
172 |
|
173 %% test/octave.test/string/blanks-3.m |
|
174 %!error blanks (1, 2); |
|
175 |
|
176 %% test/octave.test/string/char-1.m |
|
177 %!assert(strcmp (char ([65, 83, 67, 73, 73]), "ASCII")); |
|
178 |
|
179 %% test/octave.test/string/char-2.m |
5751
|
180 %!error <Invalid call to char.*> char (); |
5590
|
181 |
|
182 %% test/octave.test/string/char-3.m |
|
183 %!test |
|
184 %! x = char ("foo", "bar", "foobar"); |
|
185 %! assert((strcmp (x(1,:), "foo ") |
|
186 %! && strcmp (x(2,:), "bar ") |
|
187 %! && strcmp (x(3,:), "foobar"))); |
|
188 |
|
189 %% test/octave.test/string/int2str-1.m |
|
190 %!assert(strcmp (int2str (-123), "-123") && strcmp (int2str (1.2), "1")); |
|
191 |
|
192 %% test/octave.test/string/int2str-2.m |
|
193 %!error int2str (); |
|
194 |
|
195 %% test/octave.test/string/int2str-3.m |
|
196 %!error int2str (1, 2); |
|
197 |
|
198 %% test/octave.test/string/num2str-1.m |
|
199 %!assert((strcmp (num2str (123), "123") && strcmp (num2str (1.23), "1.23"))); |
|
200 |
|
201 %% test/octave.test/string/num2str-2.m |
|
202 %!error num2str (); |
|
203 |
|
204 %% test/octave.test/string/num2str-3.m |
|
205 %!error num2str (1, 2, 3); |
|
206 |
|
207 %% test/octave.test/string/strcat-1.m |
|
208 %!assert((strcmp (strcat ("foo", "bar"), "foobar") |
|
209 %! && strcmp (strcat (["a"; "bb"], ["foo"; "bar"]), ["a foo"; "bbbar"]))); |
|
210 |
|
211 %% test/octave.test/string/strcat-2.m |
|
212 %!error strcat (); |
|
213 |
|
214 %% test/octave.test/string/strcat-3.m |
|
215 %!error strcat (1, 2); |
|
216 |
|
217 %% test/octave.test/string/str2mat-1.m |
|
218 %!assert(strcmp (str2mat ("a", "bb", "ccc"), ["a "; "bb "; "ccc"])); |
|
219 |
|
220 %% test/octave.test/string/str2mat-2.m |
|
221 %!error str2mat (); |
|
222 |
|
223 %% test/octave.test/string/str2mat-3.m |
|
224 %!assert(all (str2mat (1, 2, 3) == setstr ([1; 2; 3]))); |
|
225 |
|
226 %% test/octave.test/string/deblank-1.m |
|
227 %!assert(strcmp (deblank (" f o o "), " f o o")); |
|
228 |
|
229 %% test/octave.test/string/deblank-2.m |
|
230 %!error deblank (); |
|
231 |
|
232 %% test/octave.test/string/deblank-3.m |
|
233 %!error deblank ("foo", "bar"); |
|
234 |
|
235 %% test/octave.test/string/deblank-4.m |
|
236 %!error deblank (1); |
|
237 |
|
238 %% test/octave.test/string/findstr-1.m |
|
239 %!assert((findstr ("abababa", "a") == [1, 3, 5, 7] |
|
240 %! && findstr ("abababa", "aba") == [1, 3, 5] |
|
241 %! && findstr ("abababa", "aba", 0) == [1, 5])); |
|
242 |
|
243 %% test/octave.test/string/findstr-2.m |
|
244 %!error findstr (); |
|
245 |
|
246 %% test/octave.test/string/findstr-3.m |
|
247 %!error findstr ("foo", "bar", 3, 4); |
|
248 |
|
249 %% test/octave.test/string/index-1.m |
|
250 %!assert(index ("foobarbaz", "b") == 4 && index ("foobarbaz", "z") == 9); |
|
251 |
|
252 %% test/octave.test/string/index-2.m |
|
253 %!error index (); |
|
254 |
|
255 %% test/octave.test/string/index-3.m |
|
256 %!error index ("foo", "bar", 3); |
|
257 |
|
258 %% test/octave.test/string/rindex-1.m |
|
259 %!assert(rindex ("foobarbaz", "b") == 7 && rindex ("foobarbaz", "o") == 3); |
|
260 |
|
261 %% test/octave.test/string/rindex-2.m |
|
262 %!error rindex (); |
|
263 |
|
264 %% test/octave.test/string/rindex-3.m |
|
265 %!error rindex ("foo", "bar", 3); |
|
266 |
|
267 %% test/octave.test/string/split-1.m |
|
268 %!assert(all (all (split ("Test string", "t") == ["Tes "; " s "; "ring"]))); |
|
269 |
|
270 %% test/octave.test/string/split-2.m |
|
271 %!error split (); |
|
272 |
|
273 %% test/octave.test/string/split-3.m |
|
274 %!assert(all (strcmp (split ("foo bar baz", " ", 2), ["foo"; "bar baz"]))); |
|
275 |
|
276 %% test/octave.test/string/split-4.m |
|
277 %!error split ("foo", "bar", 3, 4); |
|
278 |
|
279 %% test/octave.test/string/strrep-1.m |
|
280 %!assert(strcmp (strrep ("This is a test string", "is", "&%$"), |
|
281 %! "Th&%$ &%$ a test string")); |
|
282 |
|
283 %% test/octave.test/string/strrep-2.m |
|
284 %!error strrep (); |
|
285 |
|
286 %% test/octave.test/string/strrep-3.m |
|
287 %!error strrep ("foo", "bar", 3, 4); |
|
288 |
|
289 %% test/octave.test/string/substr-1.m |
|
290 %!assert(strcmp (substr ("This is a test string", 6, 9), "is a test")); |
|
291 |
|
292 %% test/octave.test/string/substr-2.m |
|
293 %!error substr (); |
|
294 |
|
295 %% test/octave.test/string/substr-3.m |
|
296 %!error substr ("foo", 2, 3, 4); |
|
297 |
|
298 %% test/octave.test/string/strcmp-1.m |
|
299 %!assert(strcmp ("foobar", "foobar") && strcmp ("fooba", "foobar") == 0); |
|
300 |
|
301 %% test/octave.test/string/strcmp-2.m |
5751
|
302 %!error <Invalid call to strcmp.*> strcmp (); |
5590
|
303 |
|
304 %% test/octave.test/string/strcmp-3.m |
5751
|
305 %!error <Invalid call to strcmp.*> strcmp ("foo", "bar", 3); |
5590
|
306 |
|
307 %% test/octave.test/string/bin2dec-1.m |
|
308 %!assert(bin2dec ("1110") == 14); |
|
309 |
|
310 %% test/octave.test/string/bin2dec-2.m |
|
311 %!error bin2dec (); |
|
312 |
|
313 %% test/octave.test/string/bin2dec-3.m |
|
314 %!error bin2dec ("str", 1); |
|
315 |
|
316 %% test/octave.test/string/dec2bin-1.m |
|
317 %!assert(strcmp (dec2bin (14), "1110")); |
|
318 |
|
319 %% test/octave.test/string/dec2bin-2.m |
|
320 %!error dec2bin (); |
|
321 |
|
322 %% test/octave.test/string/dec2bin-3.m |
|
323 %!assert(strcmp (dec2bin (14, 6), "001110") |
|
324 %! ); |
|
325 |
|
326 %% test/octave.test/string/dec2bin-4.m |
|
327 %!error dec2bin (1, 2, 3); |
|
328 |
|
329 %% test/octave.test/string/dec2hex-1.m |
|
330 %!assert(strcmp (tolower (dec2hex (2748)), "abc")); |
|
331 |
|
332 %% test/octave.test/string/dec2hex-2.m |
|
333 %!error dec2hex (); |
|
334 |
|
335 %% test/octave.test/string/dec2hex-3.m |
|
336 %!assert(strcmp (tolower (dec2hex (2748, 5)), "00abc")); |
|
337 |
|
338 %% test/octave.test/string/dec2hex-4.m |
|
339 %!error dec2hex (1, 2, 3); |
|
340 |
|
341 %% test/octave.test/string/hex2dec-1.m |
|
342 %!assert(hex2dec ("12b") == 299 && hex2dec ("12B") == 299); |
|
343 |
|
344 %% test/octave.test/string/hex2dec-2.m |
|
345 %!error hex2dec (); |
|
346 |
|
347 %% test/octave.test/string/hex2dec-3.m |
|
348 %!error hex2dec ("str", 1); |
|
349 |
|
350 %% test/octave.test/string/str2num-1.m |
|
351 %!assert(str2num ("-1.3e2") == -130 && str2num ("[1, 2; 3, 4]") == [1, 2; 3, 4]); |
|
352 |
|
353 %% test/octave.test/string/str2num-2.m |
|
354 %!error str2num (); |
|
355 |
|
356 %% test/octave.test/string/str2num-3.m |
|
357 %!error str2num ("string", 1); |
|
358 |
|
359 %% test/octave.test/string/undo_string_escapes-1.m |
|
360 %!assert(strcmp (undo_string_escapes ("abc\a\b\n\r\t\v\f123"), |
|
361 %! "abc\\a\\b\\n\\r\\t\\v\\f123")); |
|
362 |
|
363 %% test/octave.test/string/undo_string_escapes-2.m |
5751
|
364 %!error <Invalid call to undo_string_escapes.*> undo_string_escapes (); |
5590
|
365 |
|
366 %% test/octave.test/string/undo_string_escapes-3.m |
5751
|
367 %!error <Invalid call to undo_string_escapes.*> undo_string_escapes ("string", 2); |
5590
|
368 |
|
369 %% test/octave.test/string/toascii-1.m |
|
370 %!test |
|
371 %! charset = setstr (0:127); |
|
372 %! |
|
373 %! result = 0:127; |
|
374 %! |
|
375 %! assert(all (toascii (charset) == result)); |
|
376 |
|
377 %% test/octave.test/string/toascii-3.m |
|
378 %!error toascii (1, 2); |
|
379 |
|
380 %% test/octave.test/string/toascii-3.m |
|
381 %!error toascii (1, 2); |
|
382 |
|
383 %% test/octave.test/string/tolower-1.m |
|
384 %!test |
|
385 %! charset = setstr (0:127); |
|
386 %! |
|
387 %! result = charset; |
|
388 %! |
|
389 %! result ((toascii("A"):toascii("Z"))+1) \ |
|
390 %! = result ((toascii("a"):toascii("z"))+1); |
|
391 %! |
|
392 %! assert(all (tolower (charset) == result)); |
|
393 |
|
394 %% test/octave.test/string/tolower-3.m |
|
395 %!error tolower (1, 2); |
|
396 |
|
397 %% test/octave.test/string/tolower-3.m |
|
398 %!error tolower (1, 2); |
|
399 |
|
400 %% test/octave.test/string/toupper-1.m |
|
401 %!test |
|
402 %! charset = setstr (0:127); |
|
403 %! |
|
404 %! result = charset; |
|
405 %! |
|
406 %! result ((toascii("a"):toascii("z"))+1) \ |
|
407 %! = result ((toascii("A"):toascii("Z"))+1); |
|
408 %! |
|
409 %! assert(all (toupper (charset) == result)); |
|
410 |
|
411 %% test/octave.test/string/toupper-3.m |
|
412 %!error toupper (1, 2); |
|
413 |
|
414 %% test/octave.test/string/toupper-3.m |
|
415 %!error toupper (1, 2); |
|
416 |
|
417 %% test/octave.test/string/isalnum-1.m |
|
418 %!test |
|
419 %! charset = setstr (0:127); |
|
420 %! |
|
421 %! result = zeros (1, 128); |
|
422 %! |
|
423 %! result ((toascii("A"):toascii("Z"))+1) = 1; |
|
424 %! result ((toascii("0"):toascii("9"))+1) = 1; |
|
425 %! result ((toascii("a"):toascii("z"))+1) = 1; |
|
426 %! |
|
427 %! assert(all (isalnum (charset) == result)); |
|
428 |
|
429 %% test/octave.test/string/isalnum-2.m |
|
430 %!error isalnum (1, 2); |
|
431 |
|
432 %% test/octave.test/string/isalnum-3.m |
|
433 %!error isalnum (); |
|
434 |
|
435 %% test/octave.test/string/isalpha-1.m |
|
436 %!test |
|
437 %! charset = setstr (0:127); |
|
438 %! |
|
439 %! result = zeros (1, 128); |
|
440 %! |
|
441 %! result ((toascii("A"):toascii("Z"))+1) = 1; |
|
442 %! result ((toascii("a"):toascii("z"))+1) = 1; |
|
443 %! |
|
444 %! assert(all (isalpha (charset) == result)); |
|
445 |
|
446 %% test/octave.test/string/isalpha-2.m |
|
447 %!error isalpha (1, 2); |
|
448 |
|
449 %% test/octave.test/string/isalpha-3.m |
|
450 %!error isalpha (); |
|
451 |
|
452 %% test/octave.test/string/isascii-1.m |
|
453 %!test |
|
454 %! charset = setstr (0:127); |
|
455 %! |
|
456 %! result = ones (1, 128); |
|
457 %! |
|
458 %! assert(all (isascii (charset) == result)); |
|
459 |
|
460 %% test/octave.test/string/isascii-2.m |
|
461 %!error isascii (1, 2); |
|
462 |
|
463 %% test/octave.test/string/isascii-3.m |
|
464 %!error isascii (); |
|
465 |
|
466 %% test/octave.test/string/iscntrl-1.m |
|
467 %!test |
|
468 %! charset = setstr (0:127); |
|
469 %! |
|
470 %! result = zeros (1, 128); |
|
471 %! |
|
472 %! result (1:32) = 1; |
|
473 %! result (128) = 1; |
|
474 %! |
|
475 %! assert(all (iscntrl (charset) == result)); |
|
476 |
|
477 %% test/octave.test/string/iscntrl-2.m |
|
478 %!error iscntrl (1, 2); |
|
479 |
|
480 %% test/octave.test/string/iscntrl-3.m |
|
481 %!error iscntrl (); |
|
482 |
|
483 %% test/octave.test/string/isdigit-1.m |
|
484 %!test |
|
485 %! charset = setstr (0:127); |
|
486 %! |
|
487 %! result = zeros (1, 128); |
|
488 %! |
|
489 %! result ((toascii("0"):toascii("9"))+1) = 1; |
|
490 %! |
|
491 %! assert(all (isdigit (charset) == result)); |
|
492 |
|
493 %% test/octave.test/string/isdigit-2.m |
|
494 %!error isdigit (1, 2); |
|
495 |
|
496 %% test/octave.test/string/isdigit-3.m |
|
497 %!error isdigit (); |
|
498 |
|
499 %% test/octave.test/string/isgraph-1.m |
|
500 %!test |
|
501 %! charset = setstr (0:127); |
|
502 %! |
|
503 %! result = zeros (1, 128); |
|
504 %! |
|
505 %! result (34:127) = 1; |
|
506 %! |
|
507 %! assert(all (isgraph (charset) == result)); |
|
508 |
|
509 %% test/octave.test/string/isgraph-2.m |
|
510 %!error isgraph (1, 2); |
|
511 |
|
512 %% test/octave.test/string/isgraph-3.m |
|
513 %!error isgraph (); |
|
514 |
|
515 %% test/octave.test/string/islower-1.m |
|
516 %!test |
|
517 %! charset = setstr (0:127); |
|
518 %! |
|
519 %! result = zeros (1, 128); |
|
520 %! |
|
521 %! result ((toascii("a"):toascii("z"))+1) = 1; |
|
522 %! |
|
523 %! assert(all (islower (charset) == result)); |
|
524 |
|
525 %% test/octave.test/string/islower-2.m |
|
526 %!error islower (1, 2); |
|
527 |
|
528 %% test/octave.test/string/islower-3.m |
|
529 %!error islower (); |
|
530 |
|
531 %% test/octave.test/string/isprint-1.m |
|
532 %!test |
|
533 %! charset = setstr (0:127); |
|
534 %! |
|
535 %! result = zeros (1, 128); |
|
536 %! |
|
537 %! result (33:127) = 1; |
|
538 %! |
|
539 %! assert(all (isprint (charset) == result)); |
|
540 |
|
541 %% test/octave.test/string/isprint-2.m |
|
542 %!error isprint (1, 2); |
|
543 |
|
544 %% test/octave.test/string/isprint-3.m |
|
545 %!error isprint (); |
|
546 |
|
547 %% test/octave.test/string/ispunct-1.m |
|
548 %!test |
|
549 %! charset = setstr (0:127); |
|
550 %! |
|
551 %! result = zeros (1, 128); |
|
552 %! |
|
553 %! result (34:48) = 1; |
|
554 %! result (59:65) = 1; |
|
555 %! result (92:97) = 1; |
|
556 %! result (124:127) = 1; |
|
557 %! |
|
558 %! assert(all (ispunct (charset) == result)); |
|
559 |
|
560 %% test/octave.test/string/ispunct-2.m |
|
561 %!error ispunct (1, 2); |
|
562 |
|
563 %% test/octave.test/string/ispunct-3.m |
|
564 %!error ispunct (); |
|
565 |
|
566 %% test/octave.test/string/isspace-1.m |
|
567 %!test |
|
568 %! charset = setstr (0:127); |
|
569 %! |
|
570 %! result = zeros (1, 128); |
|
571 %! |
|
572 %! result (toascii (" \f\n\r\t\v")+1) = 1; |
|
573 %! |
|
574 %! assert(all (isspace (charset) == result)); |
|
575 |
|
576 %% test/octave.test/string/isspace-2.m |
|
577 %!error isspace (1, 2); |
|
578 |
|
579 %% test/octave.test/string/isspace-3.m |
|
580 %!error isspace (); |
|
581 |
|
582 %% test/octave.test/string/isupper-1.m |
|
583 %!test |
|
584 %! charset = setstr (0:127); |
|
585 %! |
|
586 %! result = zeros (1, 128); |
|
587 %! |
|
588 %! result ((toascii("A"):toascii("Z"))+1) = 1; |
|
589 %! |
|
590 %! assert(all (isupper (charset) == result)); |
|
591 |
|
592 %% test/octave.test/string/isupper-2.m |
|
593 %!error isupper (1, 2); |
|
594 |
|
595 %% test/octave.test/string/isupper-3.m |
|
596 %!error isupper (); |
|
597 |
|
598 %% test/octave.test/string/isxdigit-1.m |
|
599 %!test |
|
600 %! charset = setstr (0:127); |
|
601 %! |
|
602 %! result = zeros (1, 128); |
|
603 %! |
|
604 %! result ((toascii("A"):toascii("F"))+1) = 1; |
|
605 %! result ((toascii("0"):toascii("9"))+1) = 1; |
|
606 %! result ((toascii("a"):toascii("f"))+1) = 1; |
|
607 %! |
|
608 %! assert(all (isxdigit (charset) == result)); |
|
609 |
|
610 %% test/octave.test/string/isxdigit-2.m |
|
611 %!error isxdigit (1, 2); |
|
612 |
|
613 %% test/octave.test/string/isxdigit-3.m |
|
614 %!error isxdigit (); |
|
615 |