mirror of
https://github.com/abapGit/abapGit.git
synced 2025-04-30 11:46:38 +08:00
fix format empty xml attributes
This commit is contained in:
parent
71787d74f0
commit
6812fd56f6
|
@ -21,7 +21,7 @@ CLASS zcl_abapgit_syntax_xml DEFINITION
|
|||
BEGIN OF c_regex,
|
||||
xml_tag TYPE string VALUE '[<>]', "#EC NOTEXT
|
||||
attr TYPE string VALUE '\s[-a-z:_0-9]+\s*(?==)', "#EC NOTEXT
|
||||
attr_val TYPE string VALUE '["''][^''"]+[''"]', "#EC NOTEXT
|
||||
attr_val TYPE string VALUE '["''][^''"]*[''"]', "#EC NOTEXT
|
||||
END OF c_regex .
|
||||
|
||||
METHODS constructor .
|
||||
|
|
|
@ -12,7 +12,8 @@ CLASS abapgit_syntax_xml DEFINITION FINAL FOR TESTING
|
|||
setup,
|
||||
sole_closing_xml_tag FOR TESTING RAISING cx_static_check,
|
||||
complete_xml_tag FOR TESTING RAISING cx_static_check,
|
||||
complete_xml_tag_with_closing FOR TESTING RAISING cx_static_check.
|
||||
complete_xml_tag_with_closing FOR TESTING RAISING cx_static_check,
|
||||
empty_attributes FOR TESTING RAISING cx_static_check.
|
||||
|
||||
ENDCLASS.
|
||||
|
||||
|
@ -49,4 +50,19 @@ CLASS abapgit_syntax_xml IMPLEMENTATION.
|
|||
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD empty_attributes.
|
||||
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
exp = |<span class="xml_tag"><ECTD</span>|
|
||||
&& |<span class="attr"> SAPRL</span>=|
|
||||
&& |<span class="attr_val">"751"</span>|
|
||||
&& |<span class="attr"> VERSION</span>=|
|
||||
&& |<span class="attr_val">"1.5"</span>|
|
||||
&& |<span class="attr"> DOWNLOADDATE</span>=<span class="attr_val">""</span>|
|
||||
&& |<span class="attr"> DOWNLOADTIME</span>=<span class="attr_val">""</span>|
|
||||
&& |<span class="xml_tag">></span>|
|
||||
act = mo_cut->process_line( |<ECTD SAPRL="751" VERSION="1.5" DOWNLOADDATE="" DOWNLOADTIME="">| ) ).
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
ENDCLASS.
|
||||
|
|
Loading…
Reference in New Issue
Block a user