Skip to content

Commit

Permalink
lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
oblomov-dev committed Feb 2, 2024
1 parent de08f48 commit 2e0ac5b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
20 changes: 10 additions & 10 deletions src/core/zcl_ajson.clas.locals_imp.abap
Original file line number Diff line number Diff line change
Expand Up @@ -1098,17 +1098,17 @@ class lcl_json_to_abap implementation.

method to_time.

DATA lv_h TYPE c LENGTH 2.
DATA lv_m TYPE c LENGTH 2.
DATA lv_s TYPE c LENGTH 2.

FIND FIRST OCCURRENCE OF REGEX '^(\d{2}):(\d{2}):(\d{2})(T|$)' "#EC NOTEXT
IN iv_value
SUBMATCHES lv_h lv_m lv_s.
IF sy-subrc <> 0.
data lv_h type c length 2.
data lv_m type c length 2.
data lv_s type c length 2.

find first occurrence of regex '^(\d{2}):(\d{2}):(\d{2})(T|$)' "#EC NOTEXT
in iv_value
submatches lv_h lv_m lv_s.
if sy-subrc <> 0.
z2ui5_cx_ajson_error=>raise( 'Unexpected time format' ).
ENDIF.
CONCATENATE lv_h lv_m lv_s INTO rv_result.
endif.
concatenate lv_h lv_m lv_s into rv_result.

endmethod.

Expand Down
22 changes: 11 additions & 11 deletions src/core/zcl_ajson.clas.testclasses.abap
Original file line number Diff line number Diff line change
Expand Up @@ -1458,8 +1458,8 @@ class ltcl_json_to_abap definition
for testing
raising zcx_ajson_error.
methods to_abap_time
FOR TESTING
reaising cx_static_check.
for testing
raising cx_static_check.
endclass.

class zcl_ajson definition local friends ltcl_json_to_abap.
Expand Down Expand Up @@ -1536,27 +1536,27 @@ class ltcl_json_to_abap implementation.

endmethod.

METHOD to_abap_time.
method to_abap_time.

DATA lo_cut TYPE REF TO lcl_json_to_abap.
DATA lv_mock TYPE t.
DATA lo_nodes TYPE REF TO lcl_nodes_helper.
data lo_cut type ref to lcl_json_to_abap.
data lv_mock type t.
data lo_nodes type ref to lcl_nodes_helper.

CREATE OBJECT lo_nodes.
create object lo_nodes.
lo_nodes->add( ' | |str |11:11:11| ' ).

CREATE OBJECT lo_cut.
create object lo_cut.
lo_cut->to_abap(
EXPORTING
exporting
it_nodes = lo_nodes->sorted( )
CHANGING
changing
c_container = lv_mock ).

cl_abap_unit_assert=>assert_equals(
act = lv_mock
exp = '111111' ).

ENDMETHOD.
endmethod.

method to_abap_value.

Expand Down

0 comments on commit 2e0ac5b

Please sign in to comment.