Skip to content

Commit 0c64516

Browse files
committed
Explicitly imported public functions and constants in tests
1 parent 243d147 commit 0c64516

File tree

1 file changed

+36
-2
lines changed

1 file changed

+36
-2
lines changed

src/tests/ascii/test_ascii.f90

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
program test_ascii
22

33
use stdlib_experimental_error, only: assert
4-
use stdlib_experimental_ascii
4+
use stdlib_experimental_ascii, only: lowercase, uppercase, digits, &
5+
octal_digits, fullhex_digits, hex_digits, lowerhex_digits, &
6+
whitespace, letters, is_alphanum, is_alpha, is_lower, is_upper, &
7+
is_digit, is_octal_digit, is_hex_digit, is_white, is_blank, &
8+
is_control, is_punctuation, is_graphical, is_printable, is_ascii, &
9+
to_lower, to_upper, LF, TAB, NUL, DEL
510

611
write(*,*) "Lowercase letters: ", lowercase
712
write(*,*) "Uppercase letters: ", uppercase
@@ -35,6 +40,9 @@ program test_ascii
3540
call test_is_white_short
3641
call test_is_white_long
3742

43+
call test_is_blank_short
44+
call test_is_blank_long
45+
3846
call test_is_control_short
3947
call test_is_control_long
4048

@@ -260,6 +268,32 @@ subroutine test_is_white_long
260268
end do
261269
end subroutine
262270

271+
subroutine test_is_blank_short
272+
write(*,*) "test_is_blank_short"
273+
call assert(is_blank(' '))
274+
call assert(is_blank(TAB))
275+
call assert(.not. is_blank('1'))
276+
call assert(.not. is_blank('a'))
277+
call assert(.not. is_blank('#'))
278+
end subroutine
279+
280+
subroutine test_is_blank_long
281+
integer :: i
282+
character(len=:), allocatable :: clist
283+
write(*,*) "test_is_blank_long"
284+
do i = 1, len(whitespace)
285+
if (whitespace(i:i) == ' ' .or. whitespace(i:i) == TAB) then
286+
call assert(is_blank(whitespace(i:i)))
287+
else
288+
call assert(.not. is_blank(whitespace(i:i)))
289+
end if
290+
end do
291+
clist = digits//letters
292+
do i = 1, len(clist)
293+
call assert(.not. is_blank(clist(i:i)))
294+
end do
295+
end subroutine
296+
263297
subroutine test_is_control_short
264298
write(*,*) "test_is_control_short"
265299
! write(*,*) is_control('\0')
@@ -283,7 +317,7 @@ subroutine test_is_control_long
283317
do i = 0, 31
284318
call assert(is_control(achar(i)))
285319
end do
286-
call assert(is_control(del))
320+
call assert(is_control(DEL))
287321

288322
clist = digits//letters//' '
289323
do i = 1, len(clist)

0 commit comments

Comments
 (0)