Skip to content

Commit 985ea13

Browse files
authored
Merge pull request #52 from scivision/fortran77print
Fortran 77 print instead of write(*,*)
2 parents b2db7bc + fff2ca2 commit 985ea13

File tree

1 file changed

+45
-45
lines changed

1 file changed

+45
-45
lines changed

src/tests/ascii/test_ascii.f90

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ program test_ascii
88
is_control, is_punctuation, is_graphical, is_printable, is_ascii, &
99
to_lower, to_upper, LF, TAB, NUL, DEL
1010

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
1818

1919
call test_is_alphanum_short
2020
call test_is_alphanum_long
@@ -69,7 +69,7 @@ program test_ascii
6969
contains
7070

7171
subroutine test_is_alphanum_short
72-
write(*,*) "test_is_alphanum_short"
72+
print *, "test_is_alphanum_short"
7373
call assert(is_alphanum('A'))
7474
call assert(is_alphanum('1'))
7575
call assert(.not. is_alphanum('#'))
@@ -82,7 +82,7 @@ subroutine test_is_alphanum_long
8282
integer :: i
8383
character(len=:), allocatable :: clist
8484

85-
write(*,*) "test_is_alphanum_long"
85+
print *, "test_is_alphanum_long"
8686

8787
clist = digits//octal_digits//fullhex_digits//letters//lowercase//uppercase
8888
do i = 1, len(clist)
@@ -96,7 +96,7 @@ subroutine test_is_alphanum_long
9696
end subroutine
9797

9898
subroutine test_is_alpha_short
99-
write(*,*) "test_is_alpha_short"
99+
print *, "test_is_alpha_short"
100100
call assert(is_alpha('A'))
101101
call assert(.not. is_alpha('1'))
102102
call assert(.not. is_alpha('#'))
@@ -109,7 +109,7 @@ subroutine test_is_alpha_long
109109
integer :: i
110110
character(len=:), allocatable :: clist
111111

112-
write(*,*) "test_is_alpha_long"
112+
print *, "test_is_alpha_long"
113113

114114
clist = letters//lowercase//uppercase
115115
do i = 1, len(clist)
@@ -123,7 +123,7 @@ subroutine test_is_alpha_long
123123
end subroutine
124124

125125
subroutine test_is_lower_short
126-
write(*,*) "test_is_lower_short"
126+
print *, "test_is_lower_short"
127127
call assert(is_lower('a'))
128128
call assert(.not. is_lower('A'))
129129
call assert(.not. is_lower('#'))
@@ -137,7 +137,7 @@ subroutine test_is_lower_long
137137
integer :: i
138138
character(len=:), allocatable :: clist
139139

140-
write(*,*) "test_is_lower_long"
140+
print *, "test_is_lower_long"
141141
do i = 1, len(lowercase)
142142
call assert(is_lower(lowercase(i:i)))
143143
end do
@@ -149,7 +149,7 @@ subroutine test_is_lower_long
149149
end subroutine
150150

151151
subroutine test_is_upper_short
152-
write(*,*) "test_is_upper_short"
152+
print *, "test_is_upper_short"
153153
call assert(is_upper('A'))
154154
call assert(.not. is_upper('a'))
155155
call assert(.not. is_upper('#'))
@@ -162,7 +162,7 @@ subroutine test_is_upper_short
162162
subroutine test_is_upper_long
163163
integer :: i
164164
character(len=:), allocatable :: clist
165-
write(*,*) "test_is_upper_long"
165+
print *, "test_is_upper_long"
166166
do i = 1, len(uppercase)
167167
call assert(is_upper(uppercase(i:i)))
168168
end do
@@ -175,7 +175,7 @@ subroutine test_is_upper_long
175175

176176

177177
subroutine test_is_digit_short
178-
write(*,*) "test_is_digit_short"
178+
print *, "test_is_digit_short"
179179
call assert(is_digit('3'))
180180
call assert(is_digit('8'))
181181
call assert(.not. is_digit('B'))
@@ -189,7 +189,7 @@ subroutine test_is_digit_short
189189
subroutine test_is_digit_long
190190
integer :: i
191191
character(len=:), allocatable :: clist
192-
write(*,*) "test_is_digit_long"
192+
print *, "test_is_digit_long"
193193
do i = 1, len(digits)
194194
call assert(is_digit(digits(i:i)))
195195
end do
@@ -201,7 +201,7 @@ subroutine test_is_digit_long
201201
end subroutine
202202

203203
subroutine test_is_octal_digit_short
204-
write(*,*) "test_is_octal_digit_short"
204+
print *, "test_is_octal_digit_short"
205205
call assert(is_octal_digit('0'))
206206
call assert(is_octal_digit('7'))
207207
call assert(.not. is_octal_digit('8'))
@@ -212,7 +212,7 @@ subroutine test_is_octal_digit_short
212212
subroutine test_is_octal_digit_long
213213
integer :: i
214214
character(len=:), allocatable :: clist
215-
write(*,*) "test_is_octal_digit_long"
215+
print *, "test_is_octal_digit_long"
216216
do i = 1, len(octal_digits)
217217
call assert(is_octal_digit(octal_digits(i:i)))
218218
end do
@@ -223,7 +223,7 @@ subroutine test_is_octal_digit_long
223223
end subroutine
224224

225225
subroutine test_is_hex_digit_short
226-
write(*,*) "test_is_hex_digit_short"
226+
print *, "test_is_hex_digit_short"
227227
call assert(is_hex_digit('0'))
228228
call assert(is_hex_digit('A'))
229229
call assert(is_hex_digit('f')) !! lowercase hex digits are accepted
@@ -235,7 +235,7 @@ subroutine test_is_hex_digit_short
235235
subroutine test_is_hex_digit_long
236236
integer :: i
237237
character(len=:), allocatable :: clist
238-
write(*,*) "test_is_hex_digit_long"
238+
print *, "test_is_hex_digit_long"
239239
do i = 1, len(fullhex_digits)
240240
call assert(is_hex_digit(fullhex_digits(i:i)))
241241
end do
@@ -246,7 +246,7 @@ subroutine test_is_hex_digit_long
246246
end subroutine
247247

248248
subroutine test_is_white_short
249-
write(*,*) "test_is_white_short"
249+
print *, "test_is_white_short"
250250
call assert(is_white(' '))
251251
call assert(is_white(TAB))
252252
call assert(is_white(LF))
@@ -258,7 +258,7 @@ subroutine test_is_white_short
258258
subroutine test_is_white_long
259259
integer :: i
260260
character(len=:), allocatable :: clist
261-
write(*,*) "test_is_white_long"
261+
print *, "test_is_white_long"
262262
do i = 1, len(whitespace)
263263
call assert(is_white(whitespace(i:i)))
264264
end do
@@ -269,7 +269,7 @@ subroutine test_is_white_long
269269
end subroutine
270270

271271
subroutine test_is_blank_short
272-
write(*,*) "test_is_blank_short"
272+
print *, "test_is_blank_short"
273273
call assert(is_blank(' '))
274274
call assert(is_blank(TAB))
275275
call assert(.not. is_blank('1'))
@@ -280,7 +280,7 @@ subroutine test_is_blank_short
280280
subroutine test_is_blank_long
281281
integer :: i
282282
character(len=:), allocatable :: clist
283-
write(*,*) "test_is_blank_long"
283+
print *, "test_is_blank_long"
284284
do i = 1, len(whitespace)
285285
if (whitespace(i:i) == ' ' .or. whitespace(i:i) == TAB) then
286286
call assert(is_blank(whitespace(i:i)))
@@ -295,25 +295,25 @@ subroutine test_is_blank_long
295295
end subroutine
296296

297297
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')
301301
call assert(is_control(new_line('a'))) ! newline is both whitespace and control
302302
call assert(.not. is_control(' '))
303303
call assert(.not. is_control('1'))
304304
call assert(.not. is_control('a'))
305305
call assert(.not. is_control('#'))
306306

307307
! 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')
311311
end subroutine
312312

313313
subroutine test_is_control_long
314314
integer :: i
315315
character(len=:), allocatable :: clist
316-
write(*,*) "test_is_control_long"
316+
print *, "test_is_control_long"
317317
do i = 0, 31
318318
call assert(is_control(achar(i)))
319319
end do
@@ -326,7 +326,7 @@ subroutine test_is_control_long
326326
end subroutine
327327

328328
subroutine test_is_punctuation_short
329-
write(*,*) "test_is_punctuation_short"
329+
print *, "test_is_punctuation_short"
330330
call assert(is_punctuation('.'))
331331
call assert(is_punctuation(','))
332332
call assert(is_punctuation(':'))
@@ -343,13 +343,13 @@ subroutine test_is_punctuation_short
343343
call assert(.not. is_punctuation(NUL))
344344

345345
! 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)
347347
end subroutine
348348

349349
subroutine test_is_punctuation_long
350350
integer :: i
351351
character(len=1) :: c
352-
write(*,*) "test_is_punctuation_long"
352+
print *, "test_is_punctuation_long"
353353
do i = 0, 127
354354
c = achar(i)
355355
if (is_control(c) .or. is_alphanum(c) .or. c == ' ') then
@@ -361,7 +361,7 @@ subroutine test_is_punctuation_long
361361
end subroutine
362362

363363
subroutine test_is_graphical_short
364-
write(*,*) "test_is_graphical"
364+
print *, "test_is_graphical"
365365
call assert(is_graphical('1'))
366366
call assert(is_graphical('a'))
367367
call assert(is_graphical('#'))
@@ -376,7 +376,7 @@ subroutine test_is_graphical_short
376376
subroutine test_is_graphical_long
377377
integer :: i
378378
character(len=1) :: c
379-
write(*,*) "test_is_graphical_long"
379+
print *, "test_is_graphical_long"
380380
do i = 0, 127
381381
c = achar(i)
382382
if (is_control(c) .or. c == ' ') then
@@ -388,7 +388,7 @@ subroutine test_is_graphical_long
388388
end subroutine
389389

390390
subroutine test_is_printable_short
391-
write(*,*) "test_is_printable_short"
391+
print *, "test_is_printable_short"
392392
call assert(is_printable(' ')) ! whitespace is printable
393393
call assert(is_printable('1'))
394394
call assert(is_printable('a'))
@@ -402,7 +402,7 @@ subroutine test_is_printable_short
402402
subroutine test_is_printable_long
403403
integer :: i
404404
character(len=1) :: c
405-
write(*,*) "test_is_printable_long"
405+
print *, "test_is_printable_long"
406406
do i = 0, 127
407407
c = achar(i)
408408
if (is_control(c)) then
@@ -414,14 +414,14 @@ subroutine test_is_printable_long
414414
end subroutine
415415

416416
subroutine test_is_ascii_short()
417-
write(*,*) "test_is_ascii_short"
417+
print *, "test_is_ascii_short"
418418
call assert(is_ascii('a'))
419419
call assert(.not. is_ascii('ä'))
420420
end subroutine
421421

422422
subroutine test_is_ascii_long()
423423
integer :: i
424-
write(*,*) "test_is_ascii_long"
424+
print *, "test_is_ascii_long"
425425
do i = 0, 127
426426
call assert(is_ascii(achar(i)))
427427
end do
@@ -430,7 +430,7 @@ subroutine test_is_ascii_long()
430430
end subroutine
431431

432432
subroutine test_to_lower_short()
433-
write(*,*) "test_to_lower_short"
433+
print *, "test_to_lower_short"
434434
call assert(to_lower('a') == 'a')
435435
call assert(to_lower('A') == 'a')
436436
call assert(to_lower('#') == '#')
@@ -439,7 +439,7 @@ subroutine test_to_lower_short()
439439
subroutine test_to_lower_long()
440440
integer :: i
441441
character(len=1) :: c
442-
write(*,*) "test_to_lower_long"
442+
print *, "test_to_lower_long"
443443
do i = 1, len(uppercase)
444444
call assert(to_lower(uppercase(i:i)) == lowercase(i:i))
445445
end do
@@ -454,7 +454,7 @@ subroutine test_to_lower_long()
454454
end subroutine
455455

456456
subroutine test_to_upper_short()
457-
write(*,*) "test_to_upper_short"
457+
print *, "test_to_upper_short"
458458
call assert(to_upper('a') == 'A')
459459
call assert(to_upper('A') == 'A')
460460
call assert(to_upper('#') == '#')
@@ -463,7 +463,7 @@ subroutine test_to_upper_short()
463463
subroutine test_to_upper_long()
464464
integer :: i
465465
character(len=1) :: c
466-
write(*,*) "test_to_upper_long"
466+
print *, "test_to_upper_long"
467467
do i = 1, len(lowercase)
468468
call assert(to_upper(lowercase(i:i)) == uppercase(i:i))
469469
end do

0 commit comments

Comments
 (0)