Skip to content

Commit

Permalink
Remove to_lower
Browse files Browse the repository at this point in the history
  • Loading branch information
mbtools committed Dec 10, 2024
1 parent 01dd5be commit 4891df4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/libs/zcl_ajson_filter_lib.clas.locals_imp.abap
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class lcl_paths_filter implementation.
data lv_full_path type string.
field-symbols <p> like line of mt_skip_paths.

lv_full_path = to_lower( is_node-path && is_node-name ).
lv_full_path = is_node-path && is_node-name.

if mv_pattern_search = abap_true.
rv_keep = abap_true.
Expand Down Expand Up @@ -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.

Expand All @@ -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.

Expand Down
7 changes: 5 additions & 2 deletions src/libs/zcl_ajson_filter_lib.clas.testclasses.abap
Original file line number Diff line number Diff line change
Expand Up @@ -243,17 +243,20 @@ class ltcl_filters_test implementation.
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 = 4 ).
iv_val = 5 ).

li_json_filtered = zcl_ajson=>create_from(
ii_source_json = li_json
ii_filter = zcl_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","d":4}' ).
exp = '{"a":"1","cc":"4","d":5}' ).

endmethod.

Expand Down

0 comments on commit 4891df4

Please sign in to comment.