diff --git a/.gitmodules b/.gitmodules index 551cfd8..946cb24 100644 --- a/.gitmodules +++ b/.gitmodules @@ -6,3 +6,6 @@ path = src/third_party/BeFoR64 url = https://github.com/szaghi/BeFoR64 branch = master +[submodule "src/third_party/FACE"] + path = src/third_party/FACE + url = git@github.com:szaghi/FACE.git diff --git a/src/lib/stringifor_string_t.F90 b/src/lib/stringifor_string_t.F90 index 0d17964..94606b1 100644 --- a/src/lib/stringifor_string_t.F90 +++ b/src/lib/stringifor_string_t.F90 @@ -3,6 +3,7 @@ module stringifor_string_t !< StringiFor, definition of `string` type. use, intrinsic :: iso_fortran_env, only : iostat_eor use befor64, only : b64_decode, b64_encode +use face, only : colorize use penf, only : I1P, I2P, I4P, I8P, R4P, R8P, R16P, str implicit none @@ -44,6 +45,8 @@ module stringifor_string_t procedure, pass(self) :: camelcase !< Return a string with all words capitalized without spaces. procedure, pass(self) :: capitalize !< Return a string with its first character capitalized and the rest lowercased. procedure, pass(self) :: chars !< Return the raw characters data. + generic :: colorize => & + colorize_str !< Colorize and stylize strings. procedure, pass(self) :: decode !< Decode string. procedure, pass(self) :: encode !< Encode string. procedure, pass(self) :: escape !< Escape backslashes (or custom escape character). @@ -149,6 +152,7 @@ module stringifor_string_t procedure, private, pass(self) :: sverify_string_string !< Verify replacement. procedure, private, pass(self) :: sverify_string_character !< Verify replacement. ! auxiliary methods + procedure, private, pass(self) :: colorize_str !< Colorize and stylize strings. procedure, private, pass(self) :: glob_character !< Glob search (character output). procedure, private, pass(self) :: glob_string !< Glob search (string output). procedure, private, pass(self) :: insert_string !< Insert substring into string at a specified position. @@ -930,6 +934,24 @@ pure function chars(self) result(raw) endif endfunction chars + pure function colorize_str(self, color_fg, color_bg, style) result(colorized) + !< Colorize and stylize strings, DEFAULT kind. + !< + !<```fortran + !< type(string) :: astring + !< astring = 'say all Hello WorLD!' + !< print '(L1)', astring%colorize(color_fg='red')=='say all Hello WorLD!' + !<``` + !=> T <<< + class(string), intent(in) :: self !< The string. + character(len=*), intent(in), optional :: color_fg !< Foreground color definition. + character(len=*), intent(in), optional :: color_bg !< Background color definition. + character(len=*), intent(in), optional :: style !< Style definition. + character(len=:), allocatable :: colorized !< Colorized string. + + colorized = colorize(string=self%chars(), color_fg=color_fg, color_bg=color_bg, style=style) + endfunction colorize_str + elemental function decode(self, codec) result(decoded) !< Return a string decoded accordingly the codec. !< diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-100.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-100.f90 new file mode 100644 index 0000000..473916b --- /dev/null +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-100.f90 @@ -0,0 +1,13 @@ +program volatile_doctest +use stringifor_string_t + type(string) :: astring + character(len=:), allocatable :: acharacter + logical :: test_passed(2) + astring = 'one' + acharacter = 'ONE' + test_passed(1) = ((acharacter=anotherstring).eqv..true.) + acharacter = 'ONE' + test_passed(1) = ((acharacter<=astring).eqv..true.) astring = 'ONE' - anotherstring = 'one' - test_passed(2) = ((astring>=anotherstring).eqv..false.) + acharacter = 'one' + test_passed(2) = ((acharacter<=astring).eqv..false.) astring = 'ONE' - anotherstring = 'ONE' - test_passed(3) = ((astring>=anotherstring).eqv..true.) + acharacter = 'ONE' + test_passed(3) = ((acharacter<=astring).eqv..true.) print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-104.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-104.f90 index 7ef14e4..758d5e6 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-104.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-104.f90 @@ -1,16 +1,16 @@ program volatile_doctest use stringifor_string_t type(string) :: astring - character(len=:), allocatable :: acharacter + type(string) :: anotherstring logical :: test_passed(3) astring = 'one' - acharacter = 'ONE' - test_passed(1) = ((astring>=acharacter).eqv..true.) + anotherstring = 'ONE' + test_passed(1) = ((astring>=anotherstring).eqv..true.) astring = 'ONE' - acharacter = 'one' - test_passed(2) = ((astring>=acharacter).eqv..false.) + anotherstring = 'one' + test_passed(2) = ((astring>=anotherstring).eqv..false.) astring = 'ONE' - acharacter = 'ONE' - test_passed(3) = ((astring>=acharacter).eqv..true.) + anotherstring = 'ONE' + test_passed(3) = ((astring>=anotherstring).eqv..true.) print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-105.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-105.f90 index 46fb199..7ef14e4 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-105.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-105.f90 @@ -5,12 +5,12 @@ program volatile_doctest logical :: test_passed(3) astring = 'one' acharacter = 'ONE' - test_passed(1) = ((acharacter>=astring).eqv..false.) + test_passed(1) = ((astring>=acharacter).eqv..true.) astring = 'ONE' acharacter = 'one' - test_passed(2) = ((acharacter>=astring).eqv..true.) + test_passed(2) = ((astring>=acharacter).eqv..false.) astring = 'ONE' acharacter = 'ONE' - test_passed(3) = ((acharacter>=astring).eqv..true.) + test_passed(3) = ((astring>=acharacter).eqv..true.) print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-106.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-106.f90 index 6b139f0..46fb199 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-106.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-106.f90 @@ -1,13 +1,16 @@ program volatile_doctest use stringifor_string_t type(string) :: astring - type(string) :: anotherstring - logical :: test_passed(2) + character(len=:), allocatable :: acharacter + logical :: test_passed(3) astring = 'one' - anotherstring = 'ONE' - test_passed(1) = ((astring>anotherstring).eqv..true.) + acharacter = 'ONE' + test_passed(1) = ((acharacter>=astring).eqv..false.) astring = 'ONE' - anotherstring = 'one' - test_passed(2) = ((astring>anotherstring).eqv..false.) + acharacter = 'one' + test_passed(2) = ((acharacter>=astring).eqv..true.) + astring = 'ONE' + acharacter = 'ONE' + test_passed(3) = ((acharacter>=astring).eqv..true.) print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-107.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-107.f90 index 5434057..6b139f0 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-107.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-107.f90 @@ -1,13 +1,13 @@ program volatile_doctest use stringifor_string_t type(string) :: astring - character(len=:), allocatable :: acharacter + type(string) :: anotherstring logical :: test_passed(2) astring = 'one' - acharacter = 'ONE' - test_passed(1) = ((astring>acharacter).eqv..true.) + anotherstring = 'ONE' + test_passed(1) = ((astring>anotherstring).eqv..true.) astring = 'ONE' - acharacter = 'one' - test_passed(2) = ((astring>acharacter).eqv..false.) + anotherstring = 'one' + test_passed(2) = ((astring>anotherstring).eqv..false.) print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-108.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-108.f90 index 79633d4..5434057 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-108.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-108.f90 @@ -5,9 +5,9 @@ program volatile_doctest logical :: test_passed(2) astring = 'one' acharacter = 'ONE' - test_passed(1) = ((acharacter>astring).eqv..false.) + test_passed(1) = ((astring>acharacter).eqv..true.) astring = 'ONE' acharacter = 'one' - test_passed(2) = ((acharacter>astring).eqv..true.) + test_passed(2) = ((astring>acharacter).eqv..false.) print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-109.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-109.f90 new file mode 100644 index 0000000..79633d4 --- /dev/null +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-109.f90 @@ -0,0 +1,13 @@ +program volatile_doctest +use stringifor_string_t + type(string) :: astring + character(len=:), allocatable :: acharacter + logical :: test_passed(2) + astring = 'one' + acharacter = 'ONE' + test_passed(1) = ((acharacter>astring).eqv..false.) + astring = 'ONE' + acharacter = 'one' + test_passed(2) = ((acharacter>astring).eqv..true.) + print '(L1)', all(test_passed) +endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-109.result b/src/tests/stringifor_string_t/stringifor_string_t-doctest-109.result new file mode 100644 index 0000000..96583aa --- /dev/null +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-109.result @@ -0,0 +1 @@ +T \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-28.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-28.f90 index 5e3c54c..9985a73 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-28.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-28.f90 @@ -1,6 +1,6 @@ program volatile_doctest use stringifor_string_t type(string) :: astring - astring = 'SG93IGFyZSB5b3U/' - print '(L1)', astring%decode(codec='base64')//''=='How are you?' + astring = 'say all Hello WorLD!' + print '(L1)', astring%colorize(color_fg='red')=='say all Hello WorLD!' endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-29.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-29.f90 index c82a0e0..5e3c54c 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-29.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-29.f90 @@ -1,6 +1,6 @@ program volatile_doctest use stringifor_string_t type(string) :: astring - astring = 'How are you?' - print '(L1)', astring%encode(codec='base64')//''=='SG93IGFyZSB5b3U/' + astring = 'SG93IGFyZSB5b3U/' + print '(L1)', astring%decode(codec='base64')//''=='How are you?' endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-30.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-30.f90 index 347bb1e..c82a0e0 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-30.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-30.f90 @@ -1,9 +1,6 @@ program volatile_doctest use stringifor_string_t type(string) :: astring - logical :: test_passed(2) - astring = '^\s \d+\s*' - test_passed(1) = astring%escape(to_escape='\')//''=='^\\s \\d+\\s*' - test_passed(2) = astring%escape(to_escape='\', esc='|')//''=='^|\s |\d+|\s*' - print '(L1)', all(test_passed) + astring = 'How are you?' + print '(L1)', astring%encode(codec='base64')//''=='SG93IGFyZSB5b3U/' endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-31.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-31.f90 index ca39cc4..347bb1e 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-31.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-31.f90 @@ -1,6 +1,9 @@ program volatile_doctest use stringifor_string_t type(string) :: astring - astring = '/bar/foo.tar.bz2' - print '(L1)', astring%extension()//''=='.bz2' + logical :: test_passed(2) + astring = '^\s \d+\s*' + test_passed(1) = astring%escape(to_escape='\')//''=='^\\s \\d+\\s*' + test_passed(2) = astring%escape(to_escape='\', esc='|')//''=='^|\s |\d+|\s*' + print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-32.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-32.f90 index 961e5bf..ca39cc4 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-32.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-32.f90 @@ -1,11 +1,6 @@ program volatile_doctest use stringifor_string_t type(string) :: astring - logical :: test_passed(4) - astring = 'this is string example....wow!!!' - test_passed(1) = astring%fill(width=40)//''=='00000000this is string example....wow!!!' - test_passed(2) = astring%fill(width=50)//''=='000000000000000000this is string example....wow!!!' - test_passed(3) = astring%fill(width=50, right=.true.)//''=='this is string example....wow!!!000000000000000000' - test_passed(4) = astring%fill(width=40, filling_char='*')//''=='********this is string example....wow!!!' - print '(L1)', all(test_passed) + astring = '/bar/foo.tar.bz2' + print '(L1)', astring%extension()//''=='.bz2' endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-33.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-33.f90 index 1e7a409..961e5bf 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-33.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-33.f90 @@ -1,7 +1,11 @@ program volatile_doctest use stringifor_string_t type(string) :: astring + logical :: test_passed(4) astring = 'this is string example....wow!!!' - call astring%free - print '(L1)', astring%is_allocated().eqv..false. + test_passed(1) = astring%fill(width=40)//''=='00000000this is string example....wow!!!' + test_passed(2) = astring%fill(width=50)//''=='000000000000000000this is string example....wow!!!' + test_passed(3) = astring%fill(width=50, right=.true.)//''=='this is string example....wow!!!000000000000000000' + test_passed(4) = astring%fill(width=40, filling_char='*')//''=='********this is string example....wow!!!' + print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-34.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-34.f90 index cd76f3a..1e7a409 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-34.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-34.f90 @@ -1,30 +1,7 @@ program volatile_doctest use stringifor_string_t type(string) :: astring - character(len=:), allocatable :: alist_chr(:) - 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 astring%glob(pattern='foo-*', list=alist_chr) - 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 - print '(L1)', test_passed + astring = 'this is string example....wow!!!' + call astring%free + print '(L1)', astring%is_allocated().eqv..false. endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-35.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-35.f90 index 91e1409..cd76f3a 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-35.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-35.f90 @@ -1,31 +1,30 @@ program volatile_doctest use stringifor_string_t type(string) :: astring - type(string), allocatable :: alist_str(:) + character(len=:), allocatable :: alist_chr(:) 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 astring%glob(pattern='foo-*', list=alist_str) + call astring%glob(pattern='foo-*', list=alist_chr) do f=1, Nf open(newunit=file_unit, file=files(f)) close(unit=file_unit, status='delete') enddo test_passed = .false. - outer_str: do f=1, size(alist_str, dim=1) + outer_chr: do f=1, size(alist_chr, dim=1) do ff=1, Nf - test_passed = alist_str(f) == files(ff) - if (test_passed) cycle outer_str + test_passed = alist_chr(f) == files(ff) + if (test_passed) cycle outer_chr enddo - enddo outer_str + enddo outer_chr print '(L1)', test_passed endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-36.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-36.f90 index 998f264..91e1409 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-36.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-36.f90 @@ -1,14 +1,31 @@ program volatile_doctest use stringifor_string_t type(string) :: astring - character(len=:), allocatable :: acharacter - logical :: test_passed(5) - astring = 'this is string example wow!!!' - acharacter = '... ' - test_passed(1) = astring%insert(substring=acharacter, pos=1)//''=='... this is string example wow!!!' - test_passed(2) = astring%insert(substring=acharacter, pos=23)//''=='this is string example... wow!!!' - test_passed(3) = astring%insert(substring=acharacter, pos=29)//''=='this is string example wow!!!... ' - test_passed(4) = astring%insert(substring=acharacter, pos=-1)//''=='... this is string example wow!!!' - test_passed(5) = astring%insert(substring=acharacter, pos=100)//''=='this is string example wow!!!... ' - print '(L1)', all(test_passed) + 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 astring%glob(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_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 + print '(L1)', test_passed endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-37.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-37.f90 index b5ca5b5..998f264 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-37.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-37.f90 @@ -1,14 +1,14 @@ program volatile_doctest use stringifor_string_t type(string) :: astring - type(string) :: anotherstring + character(len=:), allocatable :: acharacter logical :: test_passed(5) astring = 'this is string example wow!!!' - anotherstring = '... ' - test_passed(1) = astring%insert(substring=anotherstring, pos=1)//''=='... this is string example wow!!!' - test_passed(2) = astring%insert(substring=anotherstring, pos=23)//''=='this is string example... wow!!!' - test_passed(3) = astring%insert(substring=anotherstring, pos=29)//''=='this is string example wow!!!... ' - test_passed(4) = astring%insert(substring=anotherstring, pos=-1)//''=='... this is string example wow!!!' - test_passed(5) = astring%insert(substring=anotherstring, pos=100)//''=='this is string example wow!!!... ' + acharacter = '... ' + test_passed(1) = astring%insert(substring=acharacter, pos=1)//''=='... this is string example wow!!!' + test_passed(2) = astring%insert(substring=acharacter, pos=23)//''=='this is string example... wow!!!' + test_passed(3) = astring%insert(substring=acharacter, pos=29)//''=='this is string example wow!!!... ' + test_passed(4) = astring%insert(substring=acharacter, pos=-1)//''=='... this is string example wow!!!' + test_passed(5) = astring%insert(substring=acharacter, pos=100)//''=='this is string example wow!!!... ' print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-38.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-38.f90 index 503dd4c..b5ca5b5 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-38.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-38.f90 @@ -1,24 +1,14 @@ program volatile_doctest use stringifor_string_t type(string) :: astring - type(string) :: strings(3) + type(string) :: anotherstring logical :: test_passed(5) - strings(1) = 'one' - strings(2) = 'two' - strings(3) = 'three' - test_passed(1) = (astring%join(array=strings)//''==strings(1)//strings(2)//strings(3)) - test_passed(2) = (astring%join(array=strings, sep='-')//''==strings(1)//'-'//strings(2)//'-'//strings(3)) - call strings(1)%free - strings(2) = 'two' - strings(3) = 'three' - test_passed(3) = (astring%join(array=strings, sep='-')//''==strings(2)//'-'//strings(3)) - strings(1) = 'one' - strings(2) = 'two' - call strings(3)%free - test_passed(4) = (astring%join(array=strings, sep='-')//''==strings(1)//'-'//strings(2)) - strings(1) = 'one' - call strings(2)%free - strings(3) = 'three' - test_passed(5) = (astring%join(array=strings, sep='-')//''==strings(1)//'-'//strings(3)) + astring = 'this is string example wow!!!' + anotherstring = '... ' + test_passed(1) = astring%insert(substring=anotherstring, pos=1)//''=='... this is string example wow!!!' + test_passed(2) = astring%insert(substring=anotherstring, pos=23)//''=='this is string example... wow!!!' + test_passed(3) = astring%insert(substring=anotherstring, pos=29)//''=='this is string example wow!!!... ' + test_passed(4) = astring%insert(substring=anotherstring, pos=-1)//''=='... this is string example wow!!!' + test_passed(5) = astring%insert(substring=anotherstring, pos=100)//''=='this is string example wow!!!... ' print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-39.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-39.f90 index 0c9c5f7..503dd4c 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-39.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-39.f90 @@ -1,29 +1,24 @@ program volatile_doctest use stringifor_string_t type(string) :: astring - character(5) :: characters(3) - logical :: test_passed(6) - characters(1) = 'one' - characters(2) = 'two' - characters(3) = 'three' - test_passed(1) = (astring%join(array=characters)//''==characters(1)//characters(2)//characters(3)) - test_passed(2) = (astring%join(array=characters, sep='-')//''==characters(1)//'-'//characters(2)//'-'//characters(3)) - characters(1) = '' - characters(2) = 'two' - characters(3) = 'three' - test_passed(3) = (astring%join(array=characters, sep='-')//''==characters(2)//'-'//characters(3)) - characters(1) = 'one' - characters(2) = 'two' - characters(3) = '' - test_passed(4) = (astring%join(array=characters, sep='-')//''==characters(1)//'-'//characters(2)) - characters(1) = 'one' - characters(2) = '' - characters(3) = 'three' - test_passed(5) = (astring%join(array=characters, sep='-')//''==characters(1)//'-'//characters(3)) - characters(1) = 'one' - characters(2) = 'two' - characters(3) = 'three' - astring = '_' - test_passed(6) = (astring%join(array=characters)//''==characters(1)//'_'//characters(2)//'_'//characters(3)) + type(string) :: strings(3) + logical :: test_passed(5) + strings(1) = 'one' + strings(2) = 'two' + strings(3) = 'three' + test_passed(1) = (astring%join(array=strings)//''==strings(1)//strings(2)//strings(3)) + test_passed(2) = (astring%join(array=strings, sep='-')//''==strings(1)//'-'//strings(2)//'-'//strings(3)) + call strings(1)%free + strings(2) = 'two' + strings(3) = 'three' + test_passed(3) = (astring%join(array=strings, sep='-')//''==strings(2)//'-'//strings(3)) + strings(1) = 'one' + strings(2) = 'two' + call strings(3)%free + test_passed(4) = (astring%join(array=strings, sep='-')//''==strings(1)//'-'//strings(2)) + strings(1) = 'one' + call strings(2)%free + strings(3) = 'three' + test_passed(5) = (astring%join(array=strings, sep='-')//''==strings(1)//'-'//strings(3)) print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-40.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-40.f90 index a018152..0c9c5f7 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-40.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-40.f90 @@ -1,8 +1,29 @@ program volatile_doctest use stringifor_string_t type(string) :: astring - logical :: test_passed(1) - astring = 'Hello WorLD!' - test_passed(1) = astring%lower()//''=='hello world!' + character(5) :: characters(3) + logical :: test_passed(6) + characters(1) = 'one' + characters(2) = 'two' + characters(3) = 'three' + test_passed(1) = (astring%join(array=characters)//''==characters(1)//characters(2)//characters(3)) + test_passed(2) = (astring%join(array=characters, sep='-')//''==characters(1)//'-'//characters(2)//'-'//characters(3)) + characters(1) = '' + characters(2) = 'two' + characters(3) = 'three' + test_passed(3) = (astring%join(array=characters, sep='-')//''==characters(2)//'-'//characters(3)) + characters(1) = 'one' + characters(2) = 'two' + characters(3) = '' + test_passed(4) = (astring%join(array=characters, sep='-')//''==characters(1)//'-'//characters(2)) + characters(1) = 'one' + characters(2) = '' + characters(3) = 'three' + test_passed(5) = (astring%join(array=characters, sep='-')//''==characters(1)//'-'//characters(3)) + characters(1) = 'one' + characters(2) = 'two' + characters(3) = 'three' + astring = '_' + test_passed(6) = (astring%join(array=characters)//''==characters(1)//'_'//characters(2)//'_'//characters(3)) print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-41.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-41.f90 index d050259..a018152 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-41.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-41.f90 @@ -1,15 +1,8 @@ program volatile_doctest use stringifor_string_t type(string) :: astring - type(string) :: strings(3) - logical :: test_passed(3) + logical :: test_passed(1) astring = 'Hello WorLD!' - strings = astring%partition(sep='lo Wo') - test_passed(1) = (strings(1)//''=='Hel'.and.strings(2)//''=='lo Wo'.and.strings(3)//''=='rLD!') - strings = astring%partition(sep='Hello') - test_passed(2) = (strings(1)//''==''.and.strings(2)//''=='Hello'.and.strings(3)//''==' WorLD!') - astring = 'Hello WorLD!' - strings = astring%partition() - test_passed(3) = (strings(1)//''=='Hello'.and.strings(2)//''==' '.and.strings(3)//''=='WorLD!') + test_passed(1) = astring%lower()//''=='hello world!' print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-42.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-42.f90 index 28e8cd3..d050259 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-42.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-42.f90 @@ -1,41 +1,15 @@ program volatile_doctest use stringifor_string_t type(string) :: astring - type(string), allocatable :: strings(:) - type(string) :: line(3) - integer :: iostat - character(len=99) :: iomsg - integer :: scratch - integer :: l - logical :: test_passed(9) - line(1) = ' Hello World! ' - line(2) = 'How are you? ' - line(3) = ' All say: "Fine thanks"' - open(newunit=scratch, file='read_file_test.tmp') - write(scratch, "(A)") line(1)%chars() - write(scratch, "(A)") line(2)%chars() - write(scratch, "(A)") line(3)%chars() - close(scratch) - call astring%read_file(file='read_file_test.tmp', iostat=iostat, iomsg=iomsg) - call astring%split(tokens=strings, sep=new_line('a')) - test_passed(1) = (size(strings, dim=1)==size(line, dim=1)) - do l=1, size(strings, dim=1) - test_passed(l+1) = (strings(l)==line(l)) - enddo - open(newunit=scratch, file='read_file_test.tmp', form='UNFORMATTED', access='STREAM') - write(scratch) line(1)%chars()//new_line('a') - write(scratch) line(2)%chars()//new_line('a') - write(scratch) line(3)%chars()//new_line('a') - close(scratch) - call astring%read_file(file='read_file_test.tmp', form='unformatted', iostat=iostat, iomsg=iomsg) - call astring%split(tokens=strings, sep=new_line('a')) - test_passed(5) = (size(strings, dim=1)==size(line, dim=1)) - do l=1, size(strings, dim=1) - test_passed(l+5) = (strings(l)==line(l)) - enddo - open(newunit=scratch, file='read_file_test.tmp', form='UNFORMATTED', access='STREAM') - close(scratch, status='DELETE') - call astring%read_file(file='read_file_test.tmp', iostat=iostat) - test_passed(9) = (iostat/=0) + type(string) :: strings(3) + logical :: test_passed(3) + astring = 'Hello WorLD!' + strings = astring%partition(sep='lo Wo') + test_passed(1) = (strings(1)//''=='Hel'.and.strings(2)//''=='lo Wo'.and.strings(3)//''=='rLD!') + strings = astring%partition(sep='Hello') + test_passed(2) = (strings(1)//''==''.and.strings(2)//''=='Hello'.and.strings(3)//''==' WorLD!') + astring = 'Hello WorLD!' + strings = astring%partition() + test_passed(3) = (strings(1)//''=='Hello'.and.strings(2)//''==' '.and.strings(3)//''=='WorLD!') print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-43.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-43.f90 index e3b02c0..28e8cd3 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-43.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-43.f90 @@ -1,48 +1,41 @@ program volatile_doctest use stringifor_string_t type(string) :: astring + type(string), allocatable :: strings(:) type(string) :: line(3) integer :: iostat character(len=99) :: iomsg integer :: scratch integer :: l - logical :: test_passed(6) + logical :: test_passed(9) line(1) = ' Hello World! ' line(2) = 'How are you? ' line(3) = ' All say: "Fine thanks"' - open(newunit=scratch, status='SCRATCH') + open(newunit=scratch, file='read_file_test.tmp') write(scratch, "(A)") line(1)%chars() write(scratch, "(A)") line(2)%chars() write(scratch, "(A)") line(3)%chars() - rewind(scratch) - l = 0 - iostat = 0 - do - l = l + 1 - call astring%read_line(unit=scratch, iostat=iostat, iomsg=iomsg) - if (iostat/=0.and..not.is_iostat_eor(iostat)) then - exit - else - test_passed(l) = (astring==line(l)) - endif - enddo close(scratch) - open(newunit=scratch, status='SCRATCH', form='UNFORMATTED', access='STREAM') + call astring%read_file(file='read_file_test.tmp', iostat=iostat, iomsg=iomsg) + call astring%split(tokens=strings, sep=new_line('a')) + test_passed(1) = (size(strings, dim=1)==size(line, dim=1)) + do l=1, size(strings, dim=1) + test_passed(l+1) = (strings(l)==line(l)) + enddo + open(newunit=scratch, file='read_file_test.tmp', form='UNFORMATTED', access='STREAM') write(scratch) line(1)%chars()//new_line('a') write(scratch) line(2)%chars()//new_line('a') write(scratch) line(3)%chars()//new_line('a') - rewind(scratch) - l = 0 - iostat = 0 - do - l = l + 1 - call astring%read_line(unit=scratch, iostat=iostat, iomsg=iomsg, form='UnfORMatteD') - if (iostat/=0.and..not.is_iostat_eor(iostat)) then - exit - else - test_passed(l+3) = (astring==line(l)) - endif - enddo close(scratch) + call astring%read_file(file='read_file_test.tmp', form='unformatted', iostat=iostat, iomsg=iomsg) + call astring%split(tokens=strings, sep=new_line('a')) + test_passed(5) = (size(strings, dim=1)==size(line, dim=1)) + do l=1, size(strings, dim=1) + test_passed(l+5) = (strings(l)==line(l)) + enddo + open(newunit=scratch, file='read_file_test.tmp', form='UNFORMATTED', access='STREAM') + close(scratch, status='DELETE') + call astring%read_file(file='read_file_test.tmp', iostat=iostat) + test_passed(9) = (iostat/=0) print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-44.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-44.f90 index ef0463c..e3b02c0 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-44.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-44.f90 @@ -1,14 +1,12 @@ program volatile_doctest use stringifor_string_t type(string) :: astring - type(string), allocatable :: strings(:) type(string) :: line(3) integer :: iostat character(len=99) :: iomsg integer :: scratch integer :: l - logical :: test_passed(8) - + logical :: test_passed(6) line(1) = ' Hello World! ' line(2) = 'How are you? ' line(3) = ' All say: "Fine thanks"' @@ -16,22 +14,34 @@ program volatile_doctest write(scratch, "(A)") line(1)%chars() write(scratch, "(A)") line(2)%chars() write(scratch, "(A)") line(3)%chars() - call astring%read_lines(unit=scratch, iostat=iostat, iomsg=iomsg) - call astring%split(tokens=strings, sep=new_line('a')) - test_passed(1) = (size(strings, dim=1)==size(line, dim=1)) - do l=1, size(strings, dim=1) - test_passed(l+1) = (strings(l)==line(l)) + rewind(scratch) + l = 0 + iostat = 0 + do + l = l + 1 + call astring%read_line(unit=scratch, iostat=iostat, iomsg=iomsg) + if (iostat/=0.and..not.is_iostat_eor(iostat)) then + exit + else + test_passed(l) = (astring==line(l)) + endif enddo close(scratch) open(newunit=scratch, status='SCRATCH', form='UNFORMATTED', access='STREAM') write(scratch) line(1)%chars()//new_line('a') write(scratch) line(2)%chars()//new_line('a') write(scratch) line(3)%chars()//new_line('a') - call astring%read_lines(unit=scratch, form='unformatted', iostat=iostat, iomsg=iomsg) - call astring%split(tokens=strings, sep=new_line('a')) - test_passed(5) = (size(strings, dim=1)==size(line, dim=1)) - do l=1, size(strings, dim=1) - test_passed(l+5) = (strings(l)==line(l)) + rewind(scratch) + l = 0 + iostat = 0 + do + l = l + 1 + call astring%read_line(unit=scratch, iostat=iostat, iomsg=iomsg, form='UnfORMatteD') + if (iostat/=0.and..not.is_iostat_eor(iostat)) then + exit + else + test_passed(l+3) = (astring==line(l)) + endif enddo close(scratch) print '(L1)', all(test_passed) diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-45.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-45.f90 index d823128..ef0463c 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-45.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-45.f90 @@ -1,13 +1,38 @@ program volatile_doctest use stringifor_string_t type(string) :: astring - logical :: test_passed(3) - astring = 'When YOU are sad YOU should think to me :-)' - test_passed(1) = (astring%replace(old='YOU', new='THEY')//''=='When THEY are sad THEY should think to me :-)') - test_passed(2) = (astring%replace(old='YOU', new='THEY', count=1)//''=='When THEY are sad YOU should think to me :-)') - astring = repeat(new_line('a')//'abcd', 20) - astring = astring%replace(old=new_line('a'), new='|cr|') - astring = astring%replace(old='|cr|', new=new_line('a')//' ') - test_passed(3) = (astring//''==repeat(new_line('a')//' '//'abcd', 20)) + type(string), allocatable :: strings(:) + type(string) :: line(3) + integer :: iostat + character(len=99) :: iomsg + integer :: scratch + integer :: l + logical :: test_passed(8) + + line(1) = ' Hello World! ' + line(2) = 'How are you? ' + line(3) = ' All say: "Fine thanks"' + open(newunit=scratch, status='SCRATCH') + write(scratch, "(A)") line(1)%chars() + write(scratch, "(A)") line(2)%chars() + write(scratch, "(A)") line(3)%chars() + call astring%read_lines(unit=scratch, iostat=iostat, iomsg=iomsg) + call astring%split(tokens=strings, sep=new_line('a')) + test_passed(1) = (size(strings, dim=1)==size(line, dim=1)) + do l=1, size(strings, dim=1) + test_passed(l+1) = (strings(l)==line(l)) + enddo + close(scratch) + open(newunit=scratch, status='SCRATCH', form='UNFORMATTED', access='STREAM') + write(scratch) line(1)%chars()//new_line('a') + write(scratch) line(2)%chars()//new_line('a') + write(scratch) line(3)%chars()//new_line('a') + call astring%read_lines(unit=scratch, form='unformatted', iostat=iostat, iomsg=iomsg) + call astring%split(tokens=strings, sep=new_line('a')) + test_passed(5) = (size(strings, dim=1)==size(line, dim=1)) + do l=1, size(strings, dim=1) + test_passed(l+5) = (strings(l)==line(l)) + enddo + close(scratch) print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-46.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-46.f90 index db8377f..d823128 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-46.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-46.f90 @@ -1,10 +1,13 @@ program volatile_doctest use stringifor_string_t type(string) :: astring - logical :: test_passed(2) - astring = 'abcdefghilmnopqrstuvz' - test_passed(1) = (astring%reverse()//''=='zvutsrqponmlihgfedcba') - astring = '0123456789' - test_passed(2) = (astring%reverse()//''=='9876543210') + logical :: test_passed(3) + astring = 'When YOU are sad YOU should think to me :-)' + test_passed(1) = (astring%replace(old='YOU', new='THEY')//''=='When THEY are sad THEY should think to me :-)') + test_passed(2) = (astring%replace(old='YOU', new='THEY', count=1)//''=='When THEY are sad YOU should think to me :-)') + astring = repeat(new_line('a')//'abcd', 20) + astring = astring%replace(old=new_line('a'), new='|cr|') + astring = astring%replace(old='|cr|', new=new_line('a')//' ') + test_passed(3) = (astring//''==repeat(new_line('a')//' '//'abcd', 20)) print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-47.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-47.f90 index dbb2f01..db8377f 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-47.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-47.f90 @@ -1,27 +1,10 @@ program volatile_doctest use stringifor_string_t type(string) :: astring - type(string) :: anotherstring - character(len=:), allocatable :: acharacter - integer :: istart - integer :: iend - logical :: test_passed(5) - astring = ' hello not the first ' - anotherstring = astring%search(tag_start='', tag_end='') - test_passed(1) = anotherstring//''==' hello ' - astring = ' the nested a ' - anotherstring = astring%search(tag_start='', tag_end='') - test_passed(2) = anotherstring//''==' the nested a ' - call astring%free - anotherstring = ' the nested a ' - astring = astring%search(in_string=anotherstring, tag_start='', tag_end='') - test_passed(3) = astring//''==' the nested a ' - call astring%free - acharacter = ' the nested a ' - astring = astring%search(in_character=acharacter, tag_start='', tag_end='') - test_passed(4) = astring//''==' the nested a ' - acharacter = ' hello not the first ' - astring = astring%search(in_character=acharacter, tag_start='', tag_end='', istart=istart, iend=iend) - test_passed(5) = astring//''==acharacter(31:67) + logical :: test_passed(2) + astring = 'abcdefghilmnopqrstuvz' + test_passed(1) = (astring%reverse()//''=='zvutsrqponmlihgfedcba') + astring = '0123456789' + test_passed(2) = (astring%reverse()//''=='9876543210') print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-48.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-48.f90 index 3d49a7f..dbb2f01 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-48.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-48.f90 @@ -1,6 +1,27 @@ program volatile_doctest use stringifor_string_t type(string) :: astring - astring = 'the Quick Brown fox Jumps over the Lazy Dog.' - print "(A)", astring%slice(11,25) + type(string) :: anotherstring + character(len=:), allocatable :: acharacter + integer :: istart + integer :: iend + logical :: test_passed(5) + astring = ' hello not the first ' + anotherstring = astring%search(tag_start='', tag_end='') + test_passed(1) = anotherstring//''==' hello ' + astring = ' the nested a ' + anotherstring = astring%search(tag_start='', tag_end='') + test_passed(2) = anotherstring//''==' the nested a ' + call astring%free + anotherstring = ' the nested a ' + astring = astring%search(in_string=anotherstring, tag_start='', tag_end='') + test_passed(3) = astring//''==' the nested a ' + call astring%free + acharacter = ' the nested a ' + astring = astring%search(in_character=acharacter, tag_start='', tag_end='') + test_passed(4) = astring//''==' the nested a ' + acharacter = ' hello not the first ' + astring = astring%search(in_character=acharacter, tag_start='', tag_end='', istart=istart, iend=iend) + test_passed(5) = astring//''==acharacter(31:67) + print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-48.result b/src/tests/stringifor_string_t/stringifor_string_t-doctest-48.result index 0ba2a88..96583aa 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-48.result +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-48.result @@ -1 +1 @@ -Brown fox Jumps \ No newline at end of file +T \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-49.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-49.f90 index c3b982b..3d49a7f 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-49.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-49.f90 @@ -1,8 +1,6 @@ program volatile_doctest use stringifor_string_t type(string) :: astring - logical :: test_passed(1) astring = 'the Quick Brown fox Jumps over the Lazy Dog.' - test_passed(1) = astring%snakecase()//''=='the_quick_brown_fox_jumps_over_the_lazy_dog.' - print '(L1)', all(test_passed) + print "(A)", astring%slice(11,25) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-49.result b/src/tests/stringifor_string_t/stringifor_string_t-doctest-49.result index 96583aa..0ba2a88 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-49.result +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-49.result @@ -1 +1 @@ -T \ No newline at end of file +Brown fox Jumps \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-50.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-50.f90 index 696cdcf..c3b982b 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-50.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-50.f90 @@ -1,40 +1,8 @@ program volatile_doctest use stringifor_string_t type(string) :: astring - type(string), allocatable :: strings(:) - logical :: test_passed(11) - astring = '+ab-++cre-++cre-ab+' - call astring%split(tokens=strings, sep='+') - test_passed(1) = (strings(1)//''=='ab-'.and.strings(2)//''=='cre-'.and.strings(3)//''=='cre-ab') - astring = 'ab-++cre-++cre-ab+' - call astring%split(tokens=strings, sep='+') - test_passed(2) = (strings(1)//''=='ab-'.and.strings(2)//''=='cre-'.and.strings(3)//''=='cre-ab') - astring = 'ab-++cre-++cre-ab' - call astring%split(tokens=strings, sep='+') - test_passed(3) = (strings(1)//''=='ab-'.and.strings(2)//''=='cre-'.and.strings(3)//''=='cre-ab') - astring = 'Hello '//new_line('a')//'World!' - call astring%split(tokens=strings, sep=new_line('a')) - test_passed(4) = (strings(1)//''=='Hello '.and.strings(2)//''=='World!') - astring = 'Hello World!' - call astring%split(tokens=strings) - test_passed(5) = (strings(1)//''=='Hello'.and.strings(2)//''=='World!') - astring = '+ab-' - call astring%split(tokens=strings, sep='+') - test_passed(6) = (strings(1)//''=='ab-') - astring = '+ab-' - call astring%split(tokens=strings, sep='-') - test_passed(7) = (strings(1)//''=='+ab') - astring = '+ab-+cd-' - call astring%split(tokens=strings, sep='+') - test_passed(8) = (strings(1)//''=='ab-'.and.strings(2)//''=='cd-') - astring = 'ab-+cd-+' - call astring%split(tokens=strings, sep='+') - test_passed(9) = (strings(1)//''=='ab-'.and.strings(2)//''=='cd-') - astring = '+ab-+cd-+' - call astring%split(tokens=strings, sep='+') - test_passed(10) = (strings(1)//''=='ab-'.and.strings(2)//''=='cd-') - astring = '1-2-3-4-5-6-7-8' - call astring%split(tokens=strings, sep='-', max_tokens=3) - test_passed(11) = (strings(1)//''=='1'.and.strings(2)//''=='2'.and.strings(3)//''=='3'.and.strings(4)//''=='4-5-6-7-8') + logical :: test_passed(1) + astring = 'the Quick Brown fox Jumps over the Lazy Dog.' + test_passed(1) = astring%snakecase()//''=='the_quick_brown_fox_jumps_over_the_lazy_dog.' print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-51.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-51.f90 index 5fd7274..696cdcf 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-51.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-51.f90 @@ -2,10 +2,39 @@ program volatile_doctest use stringifor_string_t type(string) :: astring type(string), allocatable :: strings(:) - logical :: test_passed(1) - astring = '-1-2-3-4-5-6-7-8-' - call astring%split_chunked(tokens=strings, sep='-', chunks=3) - test_passed(1) = (strings(1)//''=='1'.and.strings(2)//''=='2'.and.strings(3)//''=='3'.and.strings(4)//''=='4'.and. & - strings(5)//''=='5'.and.strings(6)//''=='6'.and.strings(7)//''=='7'.and.strings(8)//''=='8') + logical :: test_passed(11) + astring = '+ab-++cre-++cre-ab+' + call astring%split(tokens=strings, sep='+') + test_passed(1) = (strings(1)//''=='ab-'.and.strings(2)//''=='cre-'.and.strings(3)//''=='cre-ab') + astring = 'ab-++cre-++cre-ab+' + call astring%split(tokens=strings, sep='+') + test_passed(2) = (strings(1)//''=='ab-'.and.strings(2)//''=='cre-'.and.strings(3)//''=='cre-ab') + astring = 'ab-++cre-++cre-ab' + call astring%split(tokens=strings, sep='+') + test_passed(3) = (strings(1)//''=='ab-'.and.strings(2)//''=='cre-'.and.strings(3)//''=='cre-ab') + astring = 'Hello '//new_line('a')//'World!' + call astring%split(tokens=strings, sep=new_line('a')) + test_passed(4) = (strings(1)//''=='Hello '.and.strings(2)//''=='World!') + astring = 'Hello World!' + call astring%split(tokens=strings) + test_passed(5) = (strings(1)//''=='Hello'.and.strings(2)//''=='World!') + astring = '+ab-' + call astring%split(tokens=strings, sep='+') + test_passed(6) = (strings(1)//''=='ab-') + astring = '+ab-' + call astring%split(tokens=strings, sep='-') + test_passed(7) = (strings(1)//''=='+ab') + astring = '+ab-+cd-' + call astring%split(tokens=strings, sep='+') + test_passed(8) = (strings(1)//''=='ab-'.and.strings(2)//''=='cd-') + astring = 'ab-+cd-+' + call astring%split(tokens=strings, sep='+') + test_passed(9) = (strings(1)//''=='ab-'.and.strings(2)//''=='cd-') + astring = '+ab-+cd-+' + call astring%split(tokens=strings, sep='+') + test_passed(10) = (strings(1)//''=='ab-'.and.strings(2)//''=='cd-') + astring = '1-2-3-4-5-6-7-8' + call astring%split(tokens=strings, sep='-', max_tokens=3) + test_passed(11) = (strings(1)//''=='1'.and.strings(2)//''=='2'.and.strings(3)//''=='3'.and.strings(4)//''=='4-5-6-7-8') print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-52.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-52.f90 index cc7229a..5fd7274 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-52.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-52.f90 @@ -1,8 +1,11 @@ program volatile_doctest use stringifor_string_t type(string) :: astring + type(string), allocatable :: strings(:) logical :: test_passed(1) - astring = 'the Quick Brown fox Jumps over the Lazy Dog.' - test_passed(1) = astring%startcase()//''=='The Quick Brown Fox Jumps Over The Lazy Dog.' + astring = '-1-2-3-4-5-6-7-8-' + call astring%split_chunked(tokens=strings, sep='-', chunks=3) + test_passed(1) = (strings(1)//''=='1'.and.strings(2)//''=='2'.and.strings(3)//''=='3'.and.strings(4)//''=='4'.and. & + strings(5)//''=='5'.and.strings(6)//''=='6'.and.strings(7)//''=='7'.and.strings(8)//''=='8') print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-53.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-53.f90 index 466c128..cc7229a 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-53.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-53.f90 @@ -2,7 +2,7 @@ program volatile_doctest use stringifor_string_t type(string) :: astring logical :: test_passed(1) - astring = ' Hello World! ' - test_passed(1) = astring%strip()//''=='Hello World!' + astring = 'the Quick Brown fox Jumps over the Lazy Dog.' + test_passed(1) = astring%startcase()//''=='The Quick Brown Fox Jumps Over The Lazy Dog.' print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-54.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-54.f90 index 2b1d893..466c128 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-54.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-54.f90 @@ -3,6 +3,6 @@ program volatile_doctest type(string) :: astring logical :: test_passed(1) astring = ' Hello World! ' - test_passed(1) = astring%swapcase()//''==' hELLO wORLD! ' + test_passed(1) = astring%strip()//''=='Hello World!' print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-55.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-55.f90 index 4d87b66..2b1d893 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-55.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-55.f90 @@ -1,23 +1,8 @@ program volatile_doctest use stringifor_string_t type(string) :: astring - character(len=:), allocatable :: tmpname - logical :: test_passed(5) - tmpname = astring%tempname() - inquire(file=tmpname, exist=test_passed(1)) - test_passed(1) = .not.test_passed(1) - tmpname = astring%tempname(is_file=.false.) - inquire(file=tmpname, exist=test_passed(2)) - test_passed(2) = .not.test_passed(2) - tmpname = astring%tempname(path='./') - inquire(file=tmpname, exist=test_passed(3)) - test_passed(3) = .not.test_passed(3) - astring = 'me-' - tmpname = astring%tempname() - inquire(file=tmpname, exist=test_passed(4)) - test_passed(4) = .not.test_passed(4) - tmpname = astring%tempname(prefix='you-') - inquire(file=tmpname, exist=test_passed(5)) - test_passed(5) = .not.test_passed(5) + logical :: test_passed(1) + astring = ' Hello World! ' + test_passed(1) = astring%swapcase()//''==' hELLO wORLD! ' print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-56.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-56.f90 index b820e20..4d87b66 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-56.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-56.f90 @@ -1,11 +1,23 @@ program volatile_doctest use stringifor_string_t - use penf type(string) :: astring - integer(I1P) :: integer_ - logical :: test_passed(1) - astring = '127' - integer_ = astring%to_number(kind=1_I1P) - test_passed(1) = integer_==127_I1P + character(len=:), allocatable :: tmpname + logical :: test_passed(5) + tmpname = astring%tempname() + inquire(file=tmpname, exist=test_passed(1)) + test_passed(1) = .not.test_passed(1) + tmpname = astring%tempname(is_file=.false.) + inquire(file=tmpname, exist=test_passed(2)) + test_passed(2) = .not.test_passed(2) + tmpname = astring%tempname(path='./') + inquire(file=tmpname, exist=test_passed(3)) + test_passed(3) = .not.test_passed(3) + astring = 'me-' + tmpname = astring%tempname() + inquire(file=tmpname, exist=test_passed(4)) + test_passed(4) = .not.test_passed(4) + tmpname = astring%tempname(prefix='you-') + inquire(file=tmpname, exist=test_passed(5)) + test_passed(5) = .not.test_passed(5) print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-57.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-57.f90 index e823362..b820e20 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-57.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-57.f90 @@ -2,10 +2,10 @@ program volatile_doctest use stringifor_string_t use penf type(string) :: astring - integer(I2P) :: integer_ + integer(I1P) :: integer_ logical :: test_passed(1) astring = '127' - integer_ = astring%to_number(kind=1_I2P) - test_passed(1) = integer_==127_I2P + integer_ = astring%to_number(kind=1_I1P) + test_passed(1) = integer_==127_I1P print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-58.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-58.f90 index e907083..e823362 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-58.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-58.f90 @@ -2,10 +2,10 @@ program volatile_doctest use stringifor_string_t use penf type(string) :: astring - integer(I4P) :: integer_ + integer(I2P) :: integer_ logical :: test_passed(1) astring = '127' - integer_ = astring%to_number(kind=1_I4P) - test_passed(1) = integer_==127_I4P + integer_ = astring%to_number(kind=1_I2P) + test_passed(1) = integer_==127_I2P print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-59.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-59.f90 index a312c26..e907083 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-59.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-59.f90 @@ -2,10 +2,10 @@ program volatile_doctest use stringifor_string_t use penf type(string) :: astring - integer(I8P) :: integer_ + integer(I4P) :: integer_ logical :: test_passed(1) astring = '127' - integer_ = astring%to_number(kind=1_I8P) - test_passed(1) = integer_==127_I8P + integer_ = astring%to_number(kind=1_I4P) + test_passed(1) = integer_==127_I4P print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-60.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-60.f90 index 34fc1fa..a312c26 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-60.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-60.f90 @@ -2,10 +2,10 @@ program volatile_doctest use stringifor_string_t use penf type(string) :: astring - real(R4P) :: real_ + integer(I8P) :: integer_ logical :: test_passed(1) - astring = '3.4e9' - real_ = astring%to_number(kind=1._R4P) - test_passed(1) = real_==3.4e9_R4P + astring = '127' + integer_ = astring%to_number(kind=1_I8P) + test_passed(1) = integer_==127_I8P print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-61.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-61.f90 index 0448a30..34fc1fa 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-61.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-61.f90 @@ -2,10 +2,10 @@ program volatile_doctest use stringifor_string_t use penf type(string) :: astring - real(R8P) :: real_ + real(R4P) :: real_ logical :: test_passed(1) astring = '3.4e9' - real_ = astring%to_number(kind=1._R8P) - test_passed(1) = real_==3.4e9_R8P + real_ = astring%to_number(kind=1._R4P) + test_passed(1) = real_==3.4e9_R4P print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-62.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-62.f90 index a59e139..0448a30 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-62.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-62.f90 @@ -2,10 +2,10 @@ program volatile_doctest use stringifor_string_t use penf type(string) :: astring - real(R16P) :: real_ + real(R8P) :: real_ logical :: test_passed(1) astring = '3.4e9' - real_ = astring%to_number(kind=1._R16P) - test_passed(1) = real_==3.4e9_R16P + real_ = astring%to_number(kind=1._R8P) + test_passed(1) = real_==3.4e9_R8P print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-63.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-63.f90 index 6652a5e..a59e139 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-63.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-63.f90 @@ -1,9 +1,11 @@ program volatile_doctest use stringifor_string_t + use penf type(string) :: astring - logical :: test_passed(2) - astring = '^\\s \\d+\\s*' - test_passed(1) = (astring%unescape(to_unescape='\')//''=='^\s \d+\s*') - test_passed(2) = (astring%unescape(to_unescape='s')//''=='^\s \\d+\s*') + real(R16P) :: real_ + logical :: test_passed(1) + astring = '3.4e9' + real_ = astring%to_number(kind=1._R16P) + test_passed(1) = real_==3.4e9_R16P print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-64.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-64.f90 index eac79ca..6652a5e 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-64.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-64.f90 @@ -1,8 +1,9 @@ program volatile_doctest use stringifor_string_t type(string) :: astring - logical :: test_passed(1) - astring = '+++ab-++cre-++cre-ab+++++' - test_passed(1) = astring%unique(substring='+')//''=='+ab-+cre-+cre-ab+' + logical :: test_passed(2) + astring = '^\\s \\d+\\s*' + test_passed(1) = (astring%unescape(to_unescape='\')//''=='^\s \d+\s*') + test_passed(2) = (astring%unescape(to_unescape='s')//''=='^\s \\d+\s*') print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-65.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-65.f90 index 14877d4..eac79ca 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-65.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-65.f90 @@ -2,7 +2,7 @@ program volatile_doctest use stringifor_string_t type(string) :: astring logical :: test_passed(1) - astring = 'Hello WorLD!' - test_passed(1) = astring%upper()//''=='HELLO WORLD!' + astring = '+++ab-++cre-++cre-ab+++++' + test_passed(1) = astring%unique(substring='+')//''=='+ab-+cre-+cre-ab+' print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-66.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-66.f90 index af79805..14877d4 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-66.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-66.f90 @@ -1,33 +1,8 @@ program volatile_doctest use stringifor_string_t type(string) :: astring - type(string) :: anotherstring - type(string), allocatable :: strings(:) - type(string) :: line(3) - integer :: iostat - character(len=99) :: iomsg - integer :: scratch - integer :: l - logical :: test_passed(8) - line(1) = ' Hello World! ' - line(2) = 'How are you? ' - line(3) = ' All say: "Fine thanks"' - anotherstring = anotherstring%join(array=line, sep=new_line('a')) - call anotherstring%write_file(file='write_file_test.tmp', iostat=iostat, iomsg=iomsg) - call astring%read_file(file='write_file_test.tmp', iostat=iostat, iomsg=iomsg) - call astring%split(tokens=strings, sep=new_line('a')) - test_passed(1) = (size(strings, dim=1)==size(line, dim=1)) - do l=1, size(strings, dim=1) - test_passed(l+1) = (strings(l)==line(l)) - enddo - call anotherstring%write_file(file='write_file_test.tmp', form='unformatted', iostat=iostat, iomsg=iomsg) - call astring%read_file(file='write_file_test.tmp', form='unformatted', iostat=iostat, iomsg=iomsg) - call astring%split(tokens=strings, sep=new_line('a')) - test_passed(5) = (size(strings, dim=1)==size(line, dim=1)) - do l=1, size(strings, dim=1) - test_passed(l+5) = (strings(l)==line(l)) - enddo - open(newunit=scratch, file='write_file_test.tmp') - close(unit=scratch, status='delete') + logical :: test_passed(1) + astring = 'Hello WorLD!' + test_passed(1) = astring%upper()//''=='HELLO WORLD!' print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-67.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-67.f90 index 9f0f08d..af79805 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-67.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-67.f90 @@ -1,12 +1,33 @@ program volatile_doctest use stringifor_string_t type(string) :: astring - logical :: test_passed(5) - astring = 'Hello WorLD!' - test_passed(1) = astring%end_with(suffix='LD!').eqv..true. - test_passed(2) = astring%end_with(suffix='lD!').eqv..false. - test_passed(3) = astring%end_with(suffix='orLD!', start=5).eqv..true. - test_passed(4) = astring%end_with(suffix='orLD!', start=8, end=12).eqv..true. - test_passed(5) = astring%end_with(suffix='!').eqv..true. + type(string) :: anotherstring + type(string), allocatable :: strings(:) + type(string) :: line(3) + integer :: iostat + character(len=99) :: iomsg + integer :: scratch + integer :: l + logical :: test_passed(8) + line(1) = ' Hello World! ' + line(2) = 'How are you? ' + line(3) = ' All say: "Fine thanks"' + anotherstring = anotherstring%join(array=line, sep=new_line('a')) + call anotherstring%write_file(file='write_file_test.tmp', iostat=iostat, iomsg=iomsg) + call astring%read_file(file='write_file_test.tmp', iostat=iostat, iomsg=iomsg) + call astring%split(tokens=strings, sep=new_line('a')) + test_passed(1) = (size(strings, dim=1)==size(line, dim=1)) + do l=1, size(strings, dim=1) + test_passed(l+1) = (strings(l)==line(l)) + enddo + call anotherstring%write_file(file='write_file_test.tmp', form='unformatted', iostat=iostat, iomsg=iomsg) + call astring%read_file(file='write_file_test.tmp', form='unformatted', iostat=iostat, iomsg=iomsg) + call astring%split(tokens=strings, sep=new_line('a')) + test_passed(5) = (size(strings, dim=1)==size(line, dim=1)) + do l=1, size(strings, dim=1) + test_passed(l+5) = (strings(l)==line(l)) + enddo + open(newunit=scratch, file='write_file_test.tmp') + close(unit=scratch, status='delete') print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-68.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-68.f90 index 4012da3..9f0f08d 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-68.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-68.f90 @@ -1,9 +1,12 @@ program volatile_doctest use stringifor_string_t type(string) :: astring - logical :: test_passed(2) - test_passed(1) = astring%is_allocated().eqv..false. - astring = 'hello' - test_passed(2) = astring%is_allocated().eqv..true. + logical :: test_passed(5) + astring = 'Hello WorLD!' + test_passed(1) = astring%end_with(suffix='LD!').eqv..true. + test_passed(2) = astring%end_with(suffix='lD!').eqv..false. + test_passed(3) = astring%end_with(suffix='orLD!', start=5).eqv..true. + test_passed(4) = astring%end_with(suffix='orLD!', start=8, end=12).eqv..true. + test_passed(5) = astring%end_with(suffix='!').eqv..true. print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-69.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-69.f90 index 55d37f0..4012da3 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-69.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-69.f90 @@ -2,9 +2,8 @@ program volatile_doctest use stringifor_string_t type(string) :: astring logical :: test_passed(2) - astring = ' -1212112.3 ' - test_passed(1) = astring%is_digit().eqv..false. - astring = '12121123' - test_passed(2) = astring%is_digit().eqv..true. + test_passed(1) = astring%is_allocated().eqv..false. + astring = 'hello' + test_passed(2) = astring%is_allocated().eqv..true. print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-70.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-70.f90 index 5f74470..55d37f0 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-70.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-70.f90 @@ -1,18 +1,10 @@ program volatile_doctest use stringifor_string_t type(string) :: astring - logical :: test_passed(6) - astring = ' -1212112 ' - test_passed(1) = astring%is_integer().eqv..true. - astring = ' -1212112' - test_passed(2) = astring%is_integer(allow_spaces=.false.).eqv..false. - astring = '-1212112 ' - test_passed(3) = astring%is_integer(allow_spaces=.false.).eqv..false. - astring = '+2e20' - test_passed(4) = astring%is_integer().eqv..true. - astring = ' -2E13 ' - test_passed(5) = astring%is_integer().eqv..true. - astring = ' -2 E13 ' - test_passed(6) = astring%is_integer().eqv..false. + logical :: test_passed(2) + astring = ' -1212112.3 ' + test_passed(1) = astring%is_digit().eqv..false. + astring = '12121123' + test_passed(2) = astring%is_digit().eqv..true. print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-71.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-71.f90 index 2064903..5f74470 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-71.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-71.f90 @@ -1,12 +1,18 @@ program volatile_doctest use stringifor_string_t type(string) :: astring - logical :: test_passed(3) - astring = ' Hello World' - test_passed(1) = astring%is_lower().eqv..false. - astring = ' HELLO WORLD' - test_passed(2) = astring%is_lower().eqv..false. - astring = ' hello world' - test_passed(3) = astring%is_lower().eqv..true. + logical :: test_passed(6) + astring = ' -1212112 ' + test_passed(1) = astring%is_integer().eqv..true. + astring = ' -1212112' + test_passed(2) = astring%is_integer(allow_spaces=.false.).eqv..false. + astring = '-1212112 ' + test_passed(3) = astring%is_integer(allow_spaces=.false.).eqv..false. + astring = '+2e20' + test_passed(4) = astring%is_integer().eqv..true. + astring = ' -2E13 ' + test_passed(5) = astring%is_integer().eqv..true. + astring = ' -2 E13 ' + test_passed(6) = astring%is_integer().eqv..false. print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-72.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-72.f90 index ed78e6c..2064903 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-72.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-72.f90 @@ -1,20 +1,12 @@ program volatile_doctest use stringifor_string_t type(string) :: astring - logical :: test_passed(7) - astring = ' -1212112 ' - test_passed(1) = astring%is_number().eqv..true. - astring = ' -121.2112 ' - test_passed(2) = astring%is_number().eqv..true. - astring = ' -1212112' - test_passed(3) = astring%is_number(allow_spaces=.false.).eqv..false. - astring = '-12121.12 ' - test_passed(4) = astring%is_number(allow_spaces=.false.).eqv..false. - astring = '+2e20' - test_passed(5) = astring%is_number().eqv..true. - astring = ' -2.4E13 ' - test_passed(6) = astring%is_number().eqv..true. - astring = ' -2 E13 ' - test_passed(7) = astring%is_number().eqv..false. + logical :: test_passed(3) + astring = ' Hello World' + test_passed(1) = astring%is_lower().eqv..false. + astring = ' HELLO WORLD' + test_passed(2) = astring%is_lower().eqv..false. + astring = ' hello world' + test_passed(3) = astring%is_lower().eqv..true. print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-73.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-73.f90 index 1026b97..ed78e6c 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-73.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-73.f90 @@ -1,18 +1,20 @@ program volatile_doctest use stringifor_string_t type(string) :: astring - logical :: test_passed(6) - astring = ' -1212112.d0 ' - test_passed(1) = astring%is_real().eqv..true. - astring = ' -1212112.d0' - test_passed(2) = astring%is_real(allow_spaces=.false.).eqv..false. - astring = '-1212112.d0 ' - test_passed(3) = astring%is_real(allow_spaces=.false.).eqv..false. - astring = '+2.e20' - test_passed(4) = astring%is_real().eqv..true. - astring = ' -2.01E13 ' - test_passed(5) = astring%is_real().eqv..true. - astring = ' -2.01 E13 ' - test_passed(6) = astring%is_real().eqv..false. + logical :: test_passed(7) + astring = ' -1212112 ' + test_passed(1) = astring%is_number().eqv..true. + astring = ' -121.2112 ' + test_passed(2) = astring%is_number().eqv..true. + astring = ' -1212112' + test_passed(3) = astring%is_number(allow_spaces=.false.).eqv..false. + astring = '-12121.12 ' + test_passed(4) = astring%is_number(allow_spaces=.false.).eqv..false. + astring = '+2e20' + test_passed(5) = astring%is_number().eqv..true. + astring = ' -2.4E13 ' + test_passed(6) = astring%is_number().eqv..true. + astring = ' -2 E13 ' + test_passed(7) = astring%is_number().eqv..false. print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-74.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-74.f90 index e5e5791..1026b97 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-74.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-74.f90 @@ -1,12 +1,18 @@ program volatile_doctest use stringifor_string_t type(string) :: astring - logical :: test_passed(3) - astring = ' Hello World' - test_passed(1) = astring%is_upper().eqv..false. - astring = ' HELLO WORLD' - test_passed(2) = astring%is_upper().eqv..true. - astring = ' hello world' - test_passed(3) = astring%is_upper().eqv..false. + logical :: test_passed(6) + astring = ' -1212112.d0 ' + test_passed(1) = astring%is_real().eqv..true. + astring = ' -1212112.d0' + test_passed(2) = astring%is_real(allow_spaces=.false.).eqv..false. + astring = '-1212112.d0 ' + test_passed(3) = astring%is_real(allow_spaces=.false.).eqv..false. + astring = '+2.e20' + test_passed(4) = astring%is_real().eqv..true. + astring = ' -2.01E13 ' + test_passed(5) = astring%is_real().eqv..true. + astring = ' -2.01 E13 ' + test_passed(6) = astring%is_real().eqv..false. print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-75.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-75.f90 index 7119c7f..e5e5791 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-75.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-75.f90 @@ -1,11 +1,12 @@ program volatile_doctest use stringifor_string_t type(string) :: astring - logical :: test_passed(4) - astring = 'Hello WorLD!' - test_passed(1) = astring%start_with(prefix='Hello').eqv..true. - test_passed(2) = astring%start_with(prefix='hell').eqv..false. - test_passed(3) = astring%start_with(prefix='llo Wor', start=3).eqv..true. - test_passed(4) = astring%start_with(prefix='lo W', start=4, end=7).eqv..true. + logical :: test_passed(3) + astring = ' Hello World' + test_passed(1) = astring%is_upper().eqv..false. + astring = ' HELLO WORLD' + test_passed(2) = astring%is_upper().eqv..true. + astring = ' hello world' + test_passed(3) = astring%is_upper().eqv..false. print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-76.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-76.f90 index 49d932f..7119c7f 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-76.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-76.f90 @@ -1,10 +1,11 @@ program volatile_doctest use stringifor_string_t type(string) :: astring - type(string) :: anotherstring - logical :: test_passed(1) - astring = 'hello' - anotherstring = astring - test_passed(1) = astring%chars()==anotherstring%chars() + logical :: test_passed(4) + astring = 'Hello WorLD!' + test_passed(1) = astring%start_with(prefix='Hello').eqv..true. + test_passed(2) = astring%start_with(prefix='hell').eqv..false. + test_passed(3) = astring%start_with(prefix='llo Wor', start=3).eqv..true. + test_passed(4) = astring%start_with(prefix='lo W', start=4, end=7).eqv..true. print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-77.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-77.f90 index 1967fb9..49d932f 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-77.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-77.f90 @@ -1,8 +1,10 @@ program volatile_doctest use stringifor_string_t type(string) :: astring + type(string) :: anotherstring logical :: test_passed(1) astring = 'hello' - test_passed(1) = astring%chars()=='hello' + anotherstring = astring + test_passed(1) = astring%chars()==anotherstring%chars() print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-78.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-78.f90 index 03954ac..1967fb9 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-78.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-78.f90 @@ -1,9 +1,8 @@ program volatile_doctest use stringifor_string_t - use penf type(string) :: astring logical :: test_passed(1) - astring = 127_I1P - test_passed(1) = astring%to_number(kind=1_I1P)==127_I1P + astring = 'hello' + test_passed(1) = astring%chars()=='hello' print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-79.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-79.f90 index 1f1ccf4..03954ac 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-79.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-79.f90 @@ -3,7 +3,7 @@ program volatile_doctest use penf type(string) :: astring logical :: test_passed(1) - astring = 127_I2P - test_passed(1) = astring%to_number(kind=1_I2P)==127_I2P + astring = 127_I1P + test_passed(1) = astring%to_number(kind=1_I1P)==127_I1P print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-80.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-80.f90 index 4944118..1f1ccf4 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-80.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-80.f90 @@ -3,7 +3,7 @@ program volatile_doctest use penf type(string) :: astring logical :: test_passed(1) - astring = 127_I4P - test_passed(1) = astring%to_number(kind=1_I4P)==127_I4P + astring = 127_I2P + test_passed(1) = astring%to_number(kind=1_I2P)==127_I2P print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-81.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-81.f90 index 54a0bbd..4944118 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-81.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-81.f90 @@ -3,7 +3,7 @@ program volatile_doctest use penf type(string) :: astring logical :: test_passed(1) - astring = 127_I8P - test_passed(1) = astring%to_number(kind=1_I8P)==127_I8P + astring = 127_I4P + test_passed(1) = astring%to_number(kind=1_I4P)==127_I4P print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-82.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-82.f90 index 44927a9..54a0bbd 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-82.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-82.f90 @@ -3,7 +3,7 @@ program volatile_doctest use penf type(string) :: astring logical :: test_passed(1) - astring = 3.021e6_R4P - test_passed(1) = astring%to_number(kind=1._R4P)==3.021e6_R4P + astring = 127_I8P + test_passed(1) = astring%to_number(kind=1_I8P)==127_I8P print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-83.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-83.f90 index 71904fe..44927a9 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-83.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-83.f90 @@ -3,7 +3,7 @@ program volatile_doctest use penf type(string) :: astring logical :: test_passed(1) - astring = 3.021e6_R8P - test_passed(1) = astring%to_number(kind=1._R8P)==3.021e6_R8P + astring = 3.021e6_R4P + test_passed(1) = astring%to_number(kind=1._R4P)==3.021e6_R4P print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-85.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-85.f90 index ee4bf8e..71904fe 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-85.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-85.f90 @@ -1,10 +1,9 @@ program volatile_doctest use stringifor_string_t + use penf type(string) :: astring - type(string) :: anotherstring logical :: test_passed(1) - astring = 'Hello ' - anotherstring = 'Bye bye' - test_passed(1) = astring//anotherstring=='Hello Bye bye' + astring = 3.021e6_R8P + test_passed(1) = astring%to_number(kind=1._R8P)==3.021e6_R8P print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-86.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-86.f90 index ad0f149..ee4bf8e 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-86.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-86.f90 @@ -1,10 +1,10 @@ program volatile_doctest use stringifor_string_t type(string) :: astring - character(len=:), allocatable :: acharacter + type(string) :: anotherstring logical :: test_passed(1) astring = 'Hello ' - acharacter = 'World!' - test_passed(1) = astring//acharacter=='Hello World!' + anotherstring = 'Bye bye' + test_passed(1) = astring//anotherstring=='Hello Bye bye' print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-87.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-87.f90 index 45259c2..ad0f149 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-87.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-87.f90 @@ -5,6 +5,6 @@ program volatile_doctest logical :: test_passed(1) astring = 'Hello ' acharacter = 'World!' - test_passed(1) = acharacter//astring=='World!Hello ' + test_passed(1) = astring//acharacter=='Hello World!' print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-88.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-88.f90 index d1520bc..45259c2 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-88.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-88.f90 @@ -1,12 +1,10 @@ program volatile_doctest use stringifor_string_t type(string) :: astring - type(string) :: anotherstring - type(string) :: yetanotherstring + character(len=:), allocatable :: acharacter logical :: test_passed(1) astring = 'Hello ' - anotherstring = 'Bye bye' - yetanotherstring = astring.cat.anotherstring - test_passed(1) = yetanotherstring%chars()=='Hello Bye bye' + acharacter = 'World!' + test_passed(1) = acharacter//astring=='World!Hello ' print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-89.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-89.f90 index 50c6f78..d1520bc 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-89.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-89.f90 @@ -1,12 +1,12 @@ program volatile_doctest use stringifor_string_t type(string) :: astring + type(string) :: anotherstring type(string) :: yetanotherstring - character(len=:), allocatable :: acharacter logical :: test_passed(1) astring = 'Hello ' - acharacter = 'World!' - yetanotherstring = astring.cat.acharacter - test_passed(1) = yetanotherstring%chars()=='Hello World!' + anotherstring = 'Bye bye' + yetanotherstring = astring.cat.anotherstring + test_passed(1) = yetanotherstring%chars()=='Hello Bye bye' print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-90.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-90.f90 index f406f96..50c6f78 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-90.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-90.f90 @@ -6,7 +6,7 @@ program volatile_doctest logical :: test_passed(1) astring = 'Hello ' acharacter = 'World!' - yetanotherstring = acharacter.cat.astring - test_passed(1) = yetanotherstring%chars()=='World!Hello ' + yetanotherstring = astring.cat.acharacter + test_passed(1) = yetanotherstring%chars()=='Hello World!' print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-91.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-91.f90 index b6cbad8..f406f96 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-91.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-91.f90 @@ -1,13 +1,12 @@ program volatile_doctest use stringifor_string_t type(string) :: astring - type(string) :: anotherstring - logical :: test_passed(2) - astring = ' one ' - anotherstring = 'two' - test_passed(1) = ((astring==anotherstring).eqv..false.) - astring = 'the same ' - anotherstring = 'the same ' - test_passed(2) = ((astring==anotherstring).eqv..true.) + type(string) :: yetanotherstring + character(len=:), allocatable :: acharacter + logical :: test_passed(1) + astring = 'Hello ' + acharacter = 'World!' + yetanotherstring = acharacter.cat.astring + test_passed(1) = yetanotherstring%chars()=='World!Hello ' print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-92.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-92.f90 index 803ff3f..b6cbad8 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-92.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-92.f90 @@ -1,13 +1,13 @@ program volatile_doctest use stringifor_string_t type(string) :: astring - character(len=:), allocatable :: acharacter + type(string) :: anotherstring logical :: test_passed(2) astring = ' one ' - acharacter = 'three' - test_passed(1) = ((astring==acharacter).eqv..false.) + anotherstring = 'two' + test_passed(1) = ((astring==anotherstring).eqv..false.) astring = 'the same ' - acharacter = 'the same ' - test_passed(2) = ((astring==acharacter).eqv..true.) + anotherstring = 'the same ' + test_passed(2) = ((astring==anotherstring).eqv..true.) print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-93.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-93.f90 index f09665c..803ff3f 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-93.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-93.f90 @@ -5,9 +5,9 @@ program volatile_doctest logical :: test_passed(2) astring = ' one ' acharacter = 'three' - test_passed(1) = ((acharacter==astring).eqv..false.) + test_passed(1) = ((astring==acharacter).eqv..false.) astring = 'the same ' acharacter = 'the same ' - test_passed(2) = ((acharacter==astring).eqv..true.) + test_passed(2) = ((astring==acharacter).eqv..true.) print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-94.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-94.f90 index 92e91f4..f09665c 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-94.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-94.f90 @@ -1,13 +1,13 @@ program volatile_doctest use stringifor_string_t type(string) :: astring - type(string) :: anotherstring + character(len=:), allocatable :: acharacter logical :: test_passed(2) astring = ' one ' - anotherstring = 'two' - test_passed(1) = ((astring/=anotherstring).eqv..true.) + acharacter = 'three' + test_passed(1) = ((acharacter==astring).eqv..false.) astring = 'the same ' - anotherstring = 'the same ' - test_passed(2) = ((astring/=anotherstring).eqv..false.) + acharacter = 'the same ' + test_passed(2) = ((acharacter==astring).eqv..true.) print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-95.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-95.f90 index ee625e3..92e91f4 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-95.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-95.f90 @@ -1,13 +1,13 @@ program volatile_doctest use stringifor_string_t type(string) :: astring - character(len=:), allocatable :: acharacter + type(string) :: anotherstring logical :: test_passed(2) astring = ' one ' - acharacter = 'three' - test_passed(1) = ((astring/=acharacter).eqv..true.) + anotherstring = 'two' + test_passed(1) = ((astring/=anotherstring).eqv..true.) astring = 'the same ' - acharacter = 'the same ' - test_passed(2) = ((astring/=acharacter).eqv..false.) + anotherstring = 'the same ' + test_passed(2) = ((astring/=anotherstring).eqv..false.) print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-96.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-96.f90 index 0d3fc6d..ee625e3 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-96.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-96.f90 @@ -5,9 +5,9 @@ program volatile_doctest logical :: test_passed(2) astring = ' one ' acharacter = 'three' - test_passed(1) = ((acharacter/=astring).eqv..true.) + test_passed(1) = ((astring/=acharacter).eqv..true.) astring = 'the same ' acharacter = 'the same ' - test_passed(2) = ((acharacter/=astring).eqv..false.) + test_passed(2) = ((astring/=acharacter).eqv..false.) print '(L1)', all(test_passed) endprogram volatile_doctest \ No newline at end of file diff --git a/src/tests/stringifor_string_t/stringifor_string_t-doctest-97.f90 b/src/tests/stringifor_string_t/stringifor_string_t-doctest-97.f90 index 7acf1b2..0d3fc6d 100644 --- a/src/tests/stringifor_string_t/stringifor_string_t-doctest-97.f90 +++ b/src/tests/stringifor_string_t/stringifor_string_t-doctest-97.f90 @@ -1,13 +1,13 @@ program volatile_doctest use stringifor_string_t type(string) :: astring - type(string) :: anotherstring + character(len=:), allocatable :: acharacter logical :: test_passed(2) - astring = 'one' - anotherstring = 'ONE' - test_passed(1) = ((astring