foxy_test_indent_tag Program

Uses

  • program~~foxy_test_indent_tag~~UsesGraph program~foxy_test_indent_tag foxy_test_indent_tag module~foxy foxy program~foxy_test_indent_tag->module~foxy module~foxy_xml_file foxy_xml_file module~foxy->module~foxy_xml_file module~foxy_xml_tag foxy_xml_tag module~foxy->module~foxy_xml_tag module~penf~6 penf module~foxy->module~penf~6 module~foxy_xml_file->module~foxy_xml_tag module~foxy_xml_file->module~penf~6 module~foxy_xml_tag->module~penf~6 module~stringifor stringifor module~foxy_xml_tag->module~stringifor module~penf_allocatable_memory~2 penf_allocatable_memory module~penf~6->module~penf_allocatable_memory~2 module~penf_b_size~2 penf_b_size module~penf~6->module~penf_b_size~2 module~penf_global_parameters_variables~3 penf_global_parameters_variables module~penf~6->module~penf_global_parameters_variables~3 module~penf_stringify~4 penf_stringify module~penf~6->module~penf_stringify~4 module~penf_allocatable_memory~2->module~penf_global_parameters_variables~3 module~penf_allocatable_memory~2->module~penf_stringify~4 iso_fortran_env iso_fortran_env module~penf_allocatable_memory~2->iso_fortran_env module~penf_b_size~2->module~penf_global_parameters_variables~3 module~penf_stringify~4->module~penf_b_size~2 module~penf_stringify~4->module~penf_global_parameters_variables~3 module~penf_stringify~4->iso_fortran_env module~stringifor->module~penf~6 module~stringifor_string_t~2 stringifor_string_t module~stringifor->module~stringifor_string_t~2 module~stringifor_string_t~2->module~penf~6 module~stringifor_string_t~2->iso_fortran_env module~befor64~3 befor64 module~stringifor_string_t~2->module~befor64~3 module~face~3 face module~stringifor_string_t~2->module~face~3 module~befor64~3->module~penf~6 module~befor64_pack_data_m befor64_pack_data_m module~befor64~3->module~befor64_pack_data_m module~face~3->iso_fortran_env module~befor64_pack_data_m->module~penf~6

Calls

program~~foxy_test_indent_tag~~CallsGraph program~foxy_test_indent_tag foxy_test_indent_tag proc~stringify xml_tag%stringify program~foxy_test_indent_tag->proc~stringify interface~str str proc~stringify->interface~str proc~attributes xml_tag%attributes proc~stringify->proc~attributes proc~chars string%chars proc~stringify->proc~chars proc~end_tag xml_tag%end_tag proc~stringify->proc~end_tag proc~is_allocated string%is_allocated proc~stringify->proc~is_allocated proc~self_closing_tag xml_tag%self_closing_tag proc~stringify->proc~self_closing_tag proc~start_tag xml_tag%start_tag proc~stringify->proc~start_tag proc~str_a_i1p str_a_I1P interface~str->proc~str_a_i1p proc~str_a_i2p str_a_I2P interface~str->proc~str_a_i2p proc~str_a_i4p str_a_I4P interface~str->proc~str_a_i4p proc~str_a_i8p str_a_I8P interface~str->proc~str_a_i8p proc~str_a_r4p str_a_R4P interface~str->proc~str_a_r4p proc~str_a_r8p str_a_R8P interface~str->proc~str_a_r8p proc~str_bol str_bol interface~str->proc~str_bol proc~str_i1p str_I1P interface~str->proc~str_i1p proc~str_i2p str_I2P interface~str->proc~str_i2p proc~str_i4p str_I4P interface~str->proc~str_i4p proc~str_i8p str_I8P interface~str->proc~str_i8p proc~str_r4p str_R4P interface~str->proc~str_r4p proc~str_r8p str_R8P interface~str->proc~str_r8p proc~strf_i1p strf_I1P interface~str->proc~strf_i1p proc~strf_i2p strf_I2P interface~str->proc~strf_i2p proc~strf_i4p strf_I4P interface~str->proc~strf_i4p proc~strf_i8p strf_I8P interface~str->proc~strf_i8p proc~strf_r4p strf_R4P interface~str->proc~strf_r4p proc~strf_r8p strf_R8P interface~str->proc~strf_r8p proc~self_closing_tag->proc~attributes proc~start_tag->proc~attributes proc~str_a_i1p->proc~str_i1p proc~str_a_i2p->proc~str_i2p proc~str_a_i4p->proc~str_i4p proc~str_a_i8p->proc~str_i8p proc~str_a_r4p->proc~str_r4p proc~str_a_r8p->proc~str_r8p proc~compact_real_string compact_real_string proc~str_r4p->proc~compact_real_string proc~str_r8p->proc~compact_real_string

Variables

Type Attributes Name Initial
character(len=:), allocatable :: source
character(len=:), allocatable :: parsed
type(xml_tag) :: a_tag
logical :: test_passed(2)

Source Code

program foxy_test_indent_tag
!< FoXy test.
use foxy, only: xml_tag

implicit none
character(len=:), allocatable :: source         !< String containing the source XML data.
character(len=:), allocatable :: parsed         !< String containing the parsed XML data.
type(xml_tag)                 :: a_tag          !< XML tag handler.
logical                       :: test_passed(2) !< List of passed tests.

test_passed = .false.

print "(A)", 'source'
source = '  <first>lorem ipsum...</first>'
print "(A)", source
print "(A)", 'created'
a_tag = xml_tag(name='first', content='lorem ipsum...', indent=2)
parsed = a_tag%stringify(is_indented=.true.)
test_passed(1) = trim(adjustl(source))==trim(adjustl(parsed))
print "(A,L1)", parsed//' Is correct? ', test_passed(1)

print "(A)", 'source'
source = '  <first>'//new_line('a')//          &
         '    lorem ipsum...'//new_line('a')// &
         '  </first>'
print "(A)", source
print "(A)", 'created'
a_tag = xml_tag(name='first', content='lorem ipsum...', indent=2)
parsed = a_tag%stringify(is_indented=.true., is_content_indented=.true.)
test_passed(2) = trim(adjustl(source))==trim(adjustl(parsed))
print "(A,L1)", parsed//' Is correct? ', test_passed(2)

print "(A,L1)", new_line('a')//'Are all tests passed? ', all(test_passed)
endprogram foxy_test_indent_tag