[create-pull-request] automated change (#1723)

Co-authored-by: oblomov-dev <oblomov-dev@users.noreply.github.com>
This commit is contained in:
github-actions[bot] 2025-02-03 14:26:26 +01:00 committed by GitHub
parent 18df8dcabe
commit 5093de7283
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 35 additions and 2 deletions

View File

@ -72,7 +72,7 @@ CLASS lcl_paths_filter IMPLEMENTATION.
ENDIF.
LOOP AT it_skip_paths INTO lv_s.
lv_s = to_lower( lv_s ).
lv_s = condense( lv_s ).
APPEND lv_s TO lt_tab.
ENDLOOP.
@ -83,7 +83,7 @@ CLASS lcl_paths_filter IMPLEMENTATION.
DELETE lt_tab INDEX sy-tabix.
CONTINUE.
ENDIF.
<s> = condense( to_lower( <s> ) ).
<s> = condense( <s> ).
ENDLOOP.
ENDIF.

View File

@ -10,6 +10,7 @@ CLASS ltcl_filters_test DEFINITION FINAL
METHODS path_filter_w_patterns FOR TESTING RAISING z2ui5_cx_ajson_error.
METHODS path_filter_deep FOR TESTING RAISING z2ui5_cx_ajson_error.
METHODS and_filter FOR TESTING RAISING z2ui5_cx_ajson_error.
METHODS mixed_case_filter FOR TESTING RAISING z2ui5_cx_ajson_error.
ENDCLASS.
@ -227,4 +228,36 @@ CLASS ltcl_filters_test IMPLEMENTATION.
ENDMETHOD.
METHOD mixed_case_filter.
DATA li_json TYPE REF TO z2ui5_if_ajson.
DATA li_json_filtered TYPE REF TO z2ui5_if_ajson.
li_json = z2ui5_cl_ajson=>create_empty( ).
li_json->set(
iv_path = '/a'
iv_val = '1' ).
li_json->set(
iv_path = '/bB'
iv_val = '2' ).
li_json->set(
iv_path = '/CC'
iv_val = '3' ).
li_json->set(
iv_path = '/cc'
iv_val = '4' ).
li_json->set(
iv_path = '/d'
iv_val = 5 ).
li_json_filtered = z2ui5_cl_ajson=>create_from(
ii_source_json = li_json
ii_filter = z2ui5_cl_ajson_filter_lib=>create_path_filter( iv_skip_paths = '/bB,/CC' ) ).
cl_abap_unit_assert=>assert_equals(
act = li_json_filtered->stringify( )
exp = '{"a":"1","cc":"4","d":5}' ).
ENDMETHOD.
ENDCLASS.