@@ -8,13 +8,13 @@ program test_ascii
8
8
is_control, is_punctuation, is_graphical, is_printable, is_ascii, &
9
9
to_lower, to_upper, LF, TAB, NUL, DEL
10
10
11
- write ( * , * ) " Lowercase letters: " , lowercase
12
- write ( * , * ) " Uppercase letters: " , uppercase
13
- write ( * , * ) " Digits: " , digits
14
- write ( * , * ) " Octal digits: " , octal_digits
15
- write ( * , * ) " Full hex digits: " , fullhex_digits
16
- write ( * , * ) " Hex digits: " , hex_digits
17
- write ( * , * ) " Lower hex digits: " , lowerhex_digits
11
+ print * , " Lowercase letters: " , lowercase
12
+ print * , " Uppercase letters: " , uppercase
13
+ print * , " Digits: " , digits
14
+ print * , " Octal digits: " , octal_digits
15
+ print * , " Full hex digits: " , fullhex_digits
16
+ print * , " Hex digits: " , hex_digits
17
+ print * , " Lower hex digits: " , lowerhex_digits
18
18
19
19
call test_is_alphanum_short
20
20
call test_is_alphanum_long
@@ -69,7 +69,7 @@ program test_ascii
69
69
contains
70
70
71
71
subroutine test_is_alphanum_short
72
- write ( * , * ) " test_is_alphanum_short"
72
+ print * , " test_is_alphanum_short"
73
73
call assert(is_alphanum(' A' ))
74
74
call assert(is_alphanum(' 1' ))
75
75
call assert(.not. is_alphanum(' #' ))
@@ -82,7 +82,7 @@ subroutine test_is_alphanum_long
82
82
integer :: i
83
83
character (len= :), allocatable :: clist
84
84
85
- write ( * , * ) " test_is_alphanum_long"
85
+ print * , " test_is_alphanum_long"
86
86
87
87
clist = digits// octal_digits// fullhex_digits// letters// lowercase// uppercase
88
88
do i = 1 , len (clist)
@@ -96,7 +96,7 @@ subroutine test_is_alphanum_long
96
96
end subroutine
97
97
98
98
subroutine test_is_alpha_short
99
- write ( * , * ) " test_is_alpha_short"
99
+ print * , " test_is_alpha_short"
100
100
call assert(is_alpha(' A' ))
101
101
call assert(.not. is_alpha(' 1' ))
102
102
call assert(.not. is_alpha(' #' ))
@@ -109,7 +109,7 @@ subroutine test_is_alpha_long
109
109
integer :: i
110
110
character (len= :), allocatable :: clist
111
111
112
- write ( * , * ) " test_is_alpha_long"
112
+ print * , " test_is_alpha_long"
113
113
114
114
clist = letters// lowercase// uppercase
115
115
do i = 1 , len (clist)
@@ -123,7 +123,7 @@ subroutine test_is_alpha_long
123
123
end subroutine
124
124
125
125
subroutine test_is_lower_short
126
- write ( * , * ) " test_is_lower_short"
126
+ print * , " test_is_lower_short"
127
127
call assert(is_lower(' a' ))
128
128
call assert(.not. is_lower(' A' ))
129
129
call assert(.not. is_lower(' #' ))
@@ -137,7 +137,7 @@ subroutine test_is_lower_long
137
137
integer :: i
138
138
character (len= :), allocatable :: clist
139
139
140
- write ( * , * ) " test_is_lower_long"
140
+ print * , " test_is_lower_long"
141
141
do i = 1 , len (lowercase)
142
142
call assert(is_lower(lowercase(i:i)))
143
143
end do
@@ -149,7 +149,7 @@ subroutine test_is_lower_long
149
149
end subroutine
150
150
151
151
subroutine test_is_upper_short
152
- write ( * , * ) " test_is_upper_short"
152
+ print * , " test_is_upper_short"
153
153
call assert(is_upper(' A' ))
154
154
call assert(.not. is_upper(' a' ))
155
155
call assert(.not. is_upper(' #' ))
@@ -162,7 +162,7 @@ subroutine test_is_upper_short
162
162
subroutine test_is_upper_long
163
163
integer :: i
164
164
character (len= :), allocatable :: clist
165
- write ( * , * ) " test_is_upper_long"
165
+ print * , " test_is_upper_long"
166
166
do i = 1 , len (uppercase)
167
167
call assert(is_upper(uppercase(i:i)))
168
168
end do
@@ -175,7 +175,7 @@ subroutine test_is_upper_long
175
175
176
176
177
177
subroutine test_is_digit_short
178
- write ( * , * ) " test_is_digit_short"
178
+ print * , " test_is_digit_short"
179
179
call assert(is_digit(' 3' ))
180
180
call assert(is_digit(' 8' ))
181
181
call assert(.not. is_digit(' B' ))
@@ -189,7 +189,7 @@ subroutine test_is_digit_short
189
189
subroutine test_is_digit_long
190
190
integer :: i
191
191
character (len= :), allocatable :: clist
192
- write ( * , * ) " test_is_digit_long"
192
+ print * , " test_is_digit_long"
193
193
do i = 1 , len (digits)
194
194
call assert(is_digit(digits (i:i)))
195
195
end do
@@ -201,7 +201,7 @@ subroutine test_is_digit_long
201
201
end subroutine
202
202
203
203
subroutine test_is_octal_digit_short
204
- write ( * , * ) " test_is_octal_digit_short"
204
+ print * , " test_is_octal_digit_short"
205
205
call assert(is_octal_digit(' 0' ))
206
206
call assert(is_octal_digit(' 7' ))
207
207
call assert(.not. is_octal_digit(' 8' ))
@@ -212,7 +212,7 @@ subroutine test_is_octal_digit_short
212
212
subroutine test_is_octal_digit_long
213
213
integer :: i
214
214
character (len= :), allocatable :: clist
215
- write ( * , * ) " test_is_octal_digit_long"
215
+ print * , " test_is_octal_digit_long"
216
216
do i = 1 , len (octal_digits)
217
217
call assert(is_octal_digit(octal_digits(i:i)))
218
218
end do
@@ -223,7 +223,7 @@ subroutine test_is_octal_digit_long
223
223
end subroutine
224
224
225
225
subroutine test_is_hex_digit_short
226
- write ( * , * ) " test_is_hex_digit_short"
226
+ print * , " test_is_hex_digit_short"
227
227
call assert(is_hex_digit(' 0' ))
228
228
call assert(is_hex_digit(' A' ))
229
229
call assert(is_hex_digit(' f' )) ! ! lowercase hex digits are accepted
@@ -235,7 +235,7 @@ subroutine test_is_hex_digit_short
235
235
subroutine test_is_hex_digit_long
236
236
integer :: i
237
237
character (len= :), allocatable :: clist
238
- write ( * , * ) " test_is_hex_digit_long"
238
+ print * , " test_is_hex_digit_long"
239
239
do i = 1 , len (fullhex_digits)
240
240
call assert(is_hex_digit(fullhex_digits(i:i)))
241
241
end do
@@ -246,7 +246,7 @@ subroutine test_is_hex_digit_long
246
246
end subroutine
247
247
248
248
subroutine test_is_white_short
249
- write ( * , * ) " test_is_white_short"
249
+ print * , " test_is_white_short"
250
250
call assert(is_white(' ' ))
251
251
call assert(is_white(TAB))
252
252
call assert(is_white(LF))
@@ -258,7 +258,7 @@ subroutine test_is_white_short
258
258
subroutine test_is_white_long
259
259
integer :: i
260
260
character (len= :), allocatable :: clist
261
- write ( * , * ) " test_is_white_long"
261
+ print * , " test_is_white_long"
262
262
do i = 1 , len (whitespace)
263
263
call assert(is_white(whitespace(i:i)))
264
264
end do
@@ -269,7 +269,7 @@ subroutine test_is_white_long
269
269
end subroutine
270
270
271
271
subroutine test_is_blank_short
272
- write ( * , * ) " test_is_blank_short"
272
+ print * , " test_is_blank_short"
273
273
call assert(is_blank(' ' ))
274
274
call assert(is_blank(TAB))
275
275
call assert(.not. is_blank(' 1' ))
@@ -280,7 +280,7 @@ subroutine test_is_blank_short
280
280
subroutine test_is_blank_long
281
281
integer :: i
282
282
character (len= :), allocatable :: clist
283
- write ( * , * ) " test_is_blank_long"
283
+ print * , " test_is_blank_long"
284
284
do i = 1 , len (whitespace)
285
285
if (whitespace(i:i) == ' ' .or. whitespace(i:i) == TAB) then
286
286
call assert(is_blank(whitespace(i:i)))
@@ -295,25 +295,25 @@ subroutine test_is_blank_long
295
295
end subroutine
296
296
297
297
subroutine test_is_control_short
298
- write ( * , * ) " test_is_control_short"
299
- ! write(*,*) is_control('\0')
300
- ! write(*,*) is_control('\022')
298
+ print * , " test_is_control_short"
299
+ ! print *, is_control('\0')
300
+ ! print *, is_control('\022')
301
301
call assert(is_control(new_line(' a' ))) ! newline is both whitespace and control
302
302
call assert(.not. is_control(' ' ))
303
303
call assert(.not. is_control(' 1' ))
304
304
call assert(.not. is_control(' a' ))
305
305
call assert(.not. is_control(' #' ))
306
306
307
307
! N.B.: non-ASCII Unicode control characters are not recognized:
308
- ! write(*,*) .not. is_control('\u0080')
309
- ! write(*,*) .not. is_control('\u2028')
310
- ! write(*,*) .not. is_control('\u2029')
308
+ ! print *, .not. is_control('\u0080')
309
+ ! print *, .not. is_control('\u2028')
310
+ ! print *, .not. is_control('\u2029')
311
311
end subroutine
312
312
313
313
subroutine test_is_control_long
314
314
integer :: i
315
315
character (len= :), allocatable :: clist
316
- write ( * , * ) " test_is_control_long"
316
+ print * , " test_is_control_long"
317
317
do i = 0 , 31
318
318
call assert(is_control(achar (i)))
319
319
end do
@@ -326,7 +326,7 @@ subroutine test_is_control_long
326
326
end subroutine
327
327
328
328
subroutine test_is_punctuation_short
329
- write ( * , * ) " test_is_punctuation_short"
329
+ print * , " test_is_punctuation_short"
330
330
call assert(is_punctuation(' .' ))
331
331
call assert(is_punctuation(' ,' ))
332
332
call assert(is_punctuation(' :' ))
@@ -343,13 +343,13 @@ subroutine test_is_punctuation_short
343
343
call assert(.not. is_punctuation(NUL))
344
344
345
345
! N.B.: Non-ASCII Unicode punctuation characters are not recognized.
346
- ! write(*,*) is_punctuation('\u2012') ! (U+2012 = en-dash)
346
+ ! print *, is_punctuation('\u2012') ! (U+2012 = en-dash)
347
347
end subroutine
348
348
349
349
subroutine test_is_punctuation_long
350
350
integer :: i
351
351
character (len= 1 ) :: c
352
- write ( * , * ) " test_is_punctuation_long"
352
+ print * , " test_is_punctuation_long"
353
353
do i = 0 , 127
354
354
c = achar (i)
355
355
if (is_control(c) .or. is_alphanum(c) .or. c == ' ' ) then
@@ -361,7 +361,7 @@ subroutine test_is_punctuation_long
361
361
end subroutine
362
362
363
363
subroutine test_is_graphical_short
364
- write ( * , * ) " test_is_graphical"
364
+ print * , " test_is_graphical"
365
365
call assert(is_graphical(' 1' ))
366
366
call assert(is_graphical(' a' ))
367
367
call assert(is_graphical(' #' ))
@@ -376,7 +376,7 @@ subroutine test_is_graphical_short
376
376
subroutine test_is_graphical_long
377
377
integer :: i
378
378
character (len= 1 ) :: c
379
- write ( * , * ) " test_is_graphical_long"
379
+ print * , " test_is_graphical_long"
380
380
do i = 0 , 127
381
381
c = achar (i)
382
382
if (is_control(c) .or. c == ' ' ) then
@@ -388,7 +388,7 @@ subroutine test_is_graphical_long
388
388
end subroutine
389
389
390
390
subroutine test_is_printable_short
391
- write ( * , * ) " test_is_printable_short"
391
+ print * , " test_is_printable_short"
392
392
call assert(is_printable(' ' )) ! whitespace is printable
393
393
call assert(is_printable(' 1' ))
394
394
call assert(is_printable(' a' ))
@@ -402,7 +402,7 @@ subroutine test_is_printable_short
402
402
subroutine test_is_printable_long
403
403
integer :: i
404
404
character (len= 1 ) :: c
405
- write ( * , * ) " test_is_printable_long"
405
+ print * , " test_is_printable_long"
406
406
do i = 0 , 127
407
407
c = achar (i)
408
408
if (is_control(c)) then
@@ -414,14 +414,14 @@ subroutine test_is_printable_long
414
414
end subroutine
415
415
416
416
subroutine test_is_ascii_short ()
417
- write ( * , * ) " test_is_ascii_short"
417
+ print * , " test_is_ascii_short"
418
418
call assert(is_ascii(' a' ))
419
419
call assert(.not. is_ascii(' ä' ))
420
420
end subroutine
421
421
422
422
subroutine test_is_ascii_long ()
423
423
integer :: i
424
- write ( * , * ) " test_is_ascii_long"
424
+ print * , " test_is_ascii_long"
425
425
do i = 0 , 127
426
426
call assert(is_ascii(achar (i)))
427
427
end do
@@ -430,7 +430,7 @@ subroutine test_is_ascii_long()
430
430
end subroutine
431
431
432
432
subroutine test_to_lower_short ()
433
- write ( * , * ) " test_to_lower_short"
433
+ print * , " test_to_lower_short"
434
434
call assert(to_lower(' a' ) == ' a' )
435
435
call assert(to_lower(' A' ) == ' a' )
436
436
call assert(to_lower(' #' ) == ' #' )
@@ -439,7 +439,7 @@ subroutine test_to_lower_short()
439
439
subroutine test_to_lower_long ()
440
440
integer :: i
441
441
character (len= 1 ) :: c
442
- write ( * , * ) " test_to_lower_long"
442
+ print * , " test_to_lower_long"
443
443
do i = 1 , len (uppercase)
444
444
call assert(to_lower(uppercase(i:i)) == lowercase(i:i))
445
445
end do
@@ -454,7 +454,7 @@ subroutine test_to_lower_long()
454
454
end subroutine
455
455
456
456
subroutine test_to_upper_short ()
457
- write ( * , * ) " test_to_upper_short"
457
+ print * , " test_to_upper_short"
458
458
call assert(to_upper(' a' ) == ' A' )
459
459
call assert(to_upper(' A' ) == ' A' )
460
460
call assert(to_upper(' #' ) == ' #' )
@@ -463,7 +463,7 @@ subroutine test_to_upper_short()
463
463
subroutine test_to_upper_long ()
464
464
integer :: i
465
465
character (len= 1 ) :: c
466
- write ( * , * ) " test_to_upper_long"
466
+ print * , " test_to_upper_long"
467
467
do i = 1 , len (lowercase)
468
468
call assert(to_upper(lowercase(i:i)) == uppercase(i:i))
469
469
end do
0 commit comments