volatile_doctest Program

Uses

  • program~~volatile_doctest~100~~UsesGraph program~volatile_doctest~100 volatile_doctest module~stringifor_string_t stringifor_string_t program~volatile_doctest~100->module~stringifor_string_t befor64 befor64 module~stringifor_string_t->befor64 face face module~stringifor_string_t->face iso_fortran_env iso_fortran_env module~stringifor_string_t->iso_fortran_env penf penf module~stringifor_string_t->penf

Calls

program~~volatile_doctest~100~~CallsGraph program~volatile_doctest~100 volatile_doctest interface~glob glob program~volatile_doctest~100->interface~glob proc~tempname string%tempname program~volatile_doctest~100->proc~tempname proc~glob_character string%glob_character interface~glob->proc~glob_character proc~glob_string string%glob_string interface~glob->proc~glob_string none~glob string%glob proc~glob_character->none~glob proc~chars string%chars proc~glob_character->proc~chars proc~glob_string->proc~tempname proc~read_file~2 string%read_file proc~glob_string->proc~read_file~2 proc~split string%split proc~glob_string->proc~split none~glob->proc~glob_character none~glob->proc~glob_string proc~read_file~2->proc~chars proc~read_lines~2 string%read_lines proc~read_file~2->proc~read_lines~2 proc~upper string%upper proc~read_file~2->proc~upper proc~partition string%partition proc~split->proc~partition proc~unique string%unique proc~split->proc~unique proc~read_line string%read_line proc~read_lines~2->proc~read_line proc~replace string%replace proc~unique->proc~replace proc~read_line->proc~chars proc~read_line->proc~upper proc~replace_one_occurrence string%replace_one_occurrence proc~replace->proc~replace_one_occurrence

Variables

Type Attributes Name Initial
type(string) :: astring
character(len=:), allocatable :: alist_chr(:)
type(string), allocatable :: alist_str(:)
integer, parameter :: Nf = 5
character(len=14) :: files(1:Nf)
integer :: file_unit
integer :: f
integer :: ff
logical :: test_passed

Source Code

program volatile_doctest
use stringifor_string_t
 type(string) :: astring
 character(len=:), allocatable :: alist_chr(:)
 type(string), allocatable :: alist_str(:)
 integer, parameter :: Nf=5
 character(14) :: files(1:Nf)
 integer :: file_unit
 integer :: f
 integer :: ff
 logical :: test_passed
 do f=1, Nf
 files(f) = astring%tempname(prefix='foo-')
 open(newunit=file_unit, file=files(f))
 write(file_unit, *)f
 close(unit=file_unit)
 enddo
 call glob(self=astring, pattern='foo-*', list=alist_chr)
 call glob(self=astring, pattern='foo-*', list=alist_str)
 do f=1, Nf
 open(newunit=file_unit, file=files(f))
 close(unit=file_unit, status='delete')
 enddo
 test_passed = .false.
 outer_chr: do f=1, size(alist_chr, dim=1)
 do ff=1, Nf
 test_passed = alist_chr(f) == files(ff)
 if (test_passed) cycle outer_chr
 enddo
 enddo outer_chr
 if (test_passed) then
 test_passed = .false.
 outer_str: do f=1, size(alist_str, dim=1)
 do ff=1, Nf
 test_passed = alist_str(f) == files(ff)
 if (test_passed) cycle outer_str
 enddo
 enddo outer_str
 endif
 print '(L1)', test_passed
endprogram volatile_doctest