mirror of
https://github.com/abapGit/abapGit.git
synced 2025-05-02 13:03:01 +08:00
add missing spaces (#1984)
* add missing spaces * plus change the approach for this unit test
This commit is contained in:
parent
ef956b9486
commit
f8075e77d7
|
@ -26,8 +26,6 @@ CLASS ltcl_calculate_patch DEFINITION FINAL FOR TESTING
|
||||||
unknown_result_type FOR TESTING RAISING cx_static_check.
|
unknown_result_type FOR TESTING RAISING cx_static_check.
|
||||||
|
|
||||||
METHODS:
|
METHODS:
|
||||||
setup,
|
|
||||||
|
|
||||||
given_diff
|
given_diff
|
||||||
IMPORTING
|
IMPORTING
|
||||||
iv_patch_flag TYPE zif_abapgit_definitions=>ty_diff-patch_flag
|
iv_patch_flag TYPE zif_abapgit_definitions=>ty_diff-patch_flag
|
||||||
|
@ -49,7 +47,6 @@ CLASS ltcl_calculate_patch DEFINITION FINAL FOR TESTING
|
||||||
DATA:
|
DATA:
|
||||||
mt_diff TYPE zif_abapgit_definitions=>ty_diffs_tt,
|
mt_diff TYPE zif_abapgit_definitions=>ty_diffs_tt,
|
||||||
mt_patch TYPE stringtab,
|
mt_patch TYPE stringtab,
|
||||||
mv_index TYPE sytabix,
|
|
||||||
mx_error TYPE REF TO zcx_abapgit_exception.
|
mx_error TYPE REF TO zcx_abapgit_exception.
|
||||||
|
|
||||||
ENDCLASS.
|
ENDCLASS.
|
||||||
|
@ -57,12 +54,6 @@ ENDCLASS.
|
||||||
|
|
||||||
CLASS ltcl_calculate_patch IMPLEMENTATION.
|
CLASS ltcl_calculate_patch IMPLEMENTATION.
|
||||||
|
|
||||||
METHOD setup.
|
|
||||||
|
|
||||||
mv_index = 0.
|
|
||||||
|
|
||||||
ENDMETHOD.
|
|
||||||
|
|
||||||
DEFINE given_diff.
|
DEFINE given_diff.
|
||||||
|
|
||||||
given_diff( iv_patch_flag = &1
|
given_diff( iv_patch_flag = &1
|
||||||
|
@ -84,10 +75,10 @@ CLASS ltcl_calculate_patch IMPLEMENTATION.
|
||||||
|
|
||||||
when_patch_is_calculated( ).
|
when_patch_is_calculated( ).
|
||||||
|
|
||||||
then_patch_should_be(:
|
then_patch_should_be(
|
||||||
' ' ),
|
|\n| &&
|
||||||
'write: `Test`.' ),
|
|write: `Test`.\n| &&
|
||||||
' ' ).
|
|\n| ).
|
||||||
|
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
@ -102,11 +93,11 @@ CLASS ltcl_calculate_patch IMPLEMENTATION.
|
||||||
|
|
||||||
when_patch_is_calculated( ).
|
when_patch_is_calculated( ).
|
||||||
|
|
||||||
then_patch_should_be(:
|
then_patch_should_be(
|
||||||
' ' ),
|
|\n| &&
|
||||||
'write: `Test`.' ),
|
|write: `Test`.\n| &&
|
||||||
'write: `Hello world`.' ),
|
|write: `Hello world`.\n| &&
|
||||||
' ' ).
|
|\n| ).
|
||||||
|
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
@ -122,12 +113,12 @@ CLASS ltcl_calculate_patch IMPLEMENTATION.
|
||||||
|
|
||||||
when_patch_is_calculated( ).
|
when_patch_is_calculated( ).
|
||||||
|
|
||||||
then_patch_should_be(:
|
then_patch_should_be(
|
||||||
' ' ),
|
|\n| &&
|
||||||
'write: `Test`.' ),
|
|write: `Test`.\n| &&
|
||||||
' ' ),
|
|\n| &&
|
||||||
'write: `Hello world`.' ),
|
|write: `Hello world`.\n| &&
|
||||||
' ' ).
|
|\n| ).
|
||||||
|
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
@ -143,11 +134,11 @@ CLASS ltcl_calculate_patch IMPLEMENTATION.
|
||||||
|
|
||||||
when_patch_is_calculated( ).
|
when_patch_is_calculated( ).
|
||||||
|
|
||||||
then_patch_should_be(:
|
then_patch_should_be(
|
||||||
' ' ),
|
|\n| &&
|
||||||
'write: `Test`.' ),
|
|write: `Test`.\n| &&
|
||||||
' ' ),
|
|\n| &&
|
||||||
' ' ).
|
|\n| ).
|
||||||
|
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
@ -161,9 +152,7 @@ CLASS ltcl_calculate_patch IMPLEMENTATION.
|
||||||
|
|
||||||
when_patch_is_calculated( ).
|
when_patch_is_calculated( ).
|
||||||
|
|
||||||
then_patch_should_be(:
|
then_patch_should_be( |\n\n| ).
|
||||||
' ' ),
|
|
||||||
' ' ).
|
|
||||||
|
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
@ -178,9 +167,7 @@ CLASS ltcl_calculate_patch IMPLEMENTATION.
|
||||||
|
|
||||||
when_patch_is_calculated( ).
|
when_patch_is_calculated( ).
|
||||||
|
|
||||||
then_patch_should_be(:
|
then_patch_should_be( |\n\n| ).
|
||||||
' ' ),
|
|
||||||
' ' ).
|
|
||||||
|
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
@ -196,10 +183,10 @@ CLASS ltcl_calculate_patch IMPLEMENTATION.
|
||||||
|
|
||||||
when_patch_is_calculated( ).
|
when_patch_is_calculated( ).
|
||||||
|
|
||||||
then_patch_should_be(:
|
then_patch_should_be(
|
||||||
' ' ),
|
|\n| &&
|
||||||
'write: `Hello world`.' ),
|
|write: `Hello world`.| &&
|
||||||
' ' ).
|
|\n| ).
|
||||||
|
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
@ -216,10 +203,11 @@ CLASS ltcl_calculate_patch IMPLEMENTATION.
|
||||||
|
|
||||||
when_patch_is_calculated( ).
|
when_patch_is_calculated( ).
|
||||||
|
|
||||||
then_patch_should_be( ' ' ).
|
then_patch_should_be(
|
||||||
then_patch_should_be( 'write: `Hello world`.' ).
|
|\n| &&
|
||||||
then_patch_should_be( 'write: `Hello 123`.' ).
|
|write: `Hello world`.\n| &&
|
||||||
then_patch_should_be( ' ' ).
|
|write: `Hello 123`.\n| &&
|
||||||
|
|\n| ).
|
||||||
|
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
@ -233,10 +221,10 @@ CLASS ltcl_calculate_patch IMPLEMENTATION.
|
||||||
|
|
||||||
when_patch_is_calculated( ).
|
when_patch_is_calculated( ).
|
||||||
|
|
||||||
then_patch_should_be(:
|
then_patch_should_be(
|
||||||
' ' ),
|
|\n| &&
|
||||||
'write: `Hello world`.' ),
|
|write: `Hello world`.\n| &&
|
||||||
' ' ).
|
|\n| ).
|
||||||
|
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
@ -251,11 +239,11 @@ CLASS ltcl_calculate_patch IMPLEMENTATION.
|
||||||
|
|
||||||
when_patch_is_calculated( ).
|
when_patch_is_calculated( ).
|
||||||
|
|
||||||
then_patch_should_be(:
|
then_patch_should_be(
|
||||||
' ' ),
|
|\n| &&
|
||||||
'write: `Hello world`.' ),
|
|write: `Hello world`.\n| &&
|
||||||
'write: `Test`.' ),
|
|write: `Test`.\n| &&
|
||||||
' ' ).
|
|\n| ).
|
||||||
|
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
@ -271,12 +259,12 @@ CLASS ltcl_calculate_patch IMPLEMENTATION.
|
||||||
|
|
||||||
when_patch_is_calculated( ).
|
when_patch_is_calculated( ).
|
||||||
|
|
||||||
then_patch_should_be(:
|
then_patch_should_be(
|
||||||
' ' ),
|
|\n| &&
|
||||||
'write: `Hello world`.' ),
|
|write: `Hello world`.\n| &&
|
||||||
' ' ),
|
|\n| &&
|
||||||
'write: `Test`.' ),
|
|write: `Test`.\n| &&
|
||||||
' ' ).
|
|\n| ).
|
||||||
|
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
@ -292,12 +280,12 @@ CLASS ltcl_calculate_patch IMPLEMENTATION.
|
||||||
|
|
||||||
when_patch_is_calculated( ).
|
when_patch_is_calculated( ).
|
||||||
|
|
||||||
then_patch_should_be(:
|
then_patch_should_be(
|
||||||
' ' ),
|
|\n| &&
|
||||||
'write: `Hello world`.' ),
|
|write: `Hello world`.\n| &&
|
||||||
' ' ),
|
|\n| &&
|
||||||
'write: `Hello world`.' ),
|
|write: `Hello world`.\n| &&
|
||||||
' ' ).
|
|\n| ).
|
||||||
|
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
@ -314,13 +302,13 @@ CLASS ltcl_calculate_patch IMPLEMENTATION.
|
||||||
|
|
||||||
when_patch_is_calculated( ).
|
when_patch_is_calculated( ).
|
||||||
|
|
||||||
then_patch_should_be(:
|
then_patch_should_be(
|
||||||
' ' ),
|
|\n| &&
|
||||||
'write: `Hello world`.' ),
|
|write: `Hello world`.\n| &&
|
||||||
' ' ),
|
|\n| &&
|
||||||
'write: `Hello world`.' ),
|
|write: `Hello world`.\n| &&
|
||||||
' ' ),
|
|\n| &&
|
||||||
'write: `newline`.' ).
|
|write: `newline`.\n| ).
|
||||||
|
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
@ -372,16 +360,22 @@ CLASS ltcl_calculate_patch IMPLEMENTATION.
|
||||||
|
|
||||||
METHOD then_patch_should_be.
|
METHOD then_patch_should_be.
|
||||||
|
|
||||||
FIELD-SYMBOLS: <ls_patch> LIKE LINE OF mt_patch.
|
DATA: lv_index TYPE i,
|
||||||
|
lt_patch TYPE STANDARD TABLE OF string WITH DEFAULT KEY,
|
||||||
|
lv_patch LIKE LINE OF lt_patch.
|
||||||
|
|
||||||
mv_index = mv_index + 1.
|
FIELD-SYMBOLS: <lv_patch> LIKE LINE OF mt_patch.
|
||||||
|
|
||||||
READ TABLE mt_patch INDEX mv_index
|
SPLIT iv_exp_patch AT |\n| INTO TABLE lt_patch IN CHARACTER MODE.
|
||||||
ASSIGNING <ls_patch>.
|
|
||||||
|
|
||||||
cl_abap_unit_assert=>assert_equals(
|
LOOP AT lt_patch INTO lv_patch.
|
||||||
exp = iv_exp_patch
|
READ TABLE mt_patch INDEX sy-tabix ASSIGNING <lv_patch>.
|
||||||
act = <ls_patch> ).
|
cl_abap_unit_assert=>assert_subrc( ).
|
||||||
|
|
||||||
|
cl_abap_unit_assert=>assert_equals(
|
||||||
|
exp = lv_patch
|
||||||
|
act = <lv_patch> ).
|
||||||
|
ENDLOOP.
|
||||||
|
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
|
@ -273,8 +273,8 @@ CLASS ZCL_ABAPGIT_GUI_PAGE_COMMIT IMPLEMENTATION.
|
||||||
|
|
||||||
ro_html->add( '<table class="stage_tab">' ).
|
ro_html->add( '<table class="stage_tab">' ).
|
||||||
ro_html->add( '<thead>' ).
|
ro_html->add( '<thead>' ).
|
||||||
ro_html->add( '<tr>').
|
ro_html->add( '<tr>' ).
|
||||||
ro_html->add( '<th colspan="2">Staged files</th>').
|
ro_html->add( '<th colspan="2">Staged files</th>' ).
|
||||||
ro_html->add( '</tr>' ).
|
ro_html->add( '</tr>' ).
|
||||||
ro_html->add( '</thead>' ).
|
ro_html->add( '</thead>' ).
|
||||||
|
|
||||||
|
|
|
@ -363,7 +363,7 @@ CLASS ZCL_ABAPGIT_GUI_PAGE_STAGE IMPLEMENTATION.
|
||||||
iv_changed_by = ls_changed_by-name ) ).
|
iv_changed_by = ls_changed_by-name ) ).
|
||||||
|
|
||||||
AT LAST.
|
AT LAST.
|
||||||
ro_html->add('</tbody>').
|
ro_html->add( '</tbody>' ).
|
||||||
ENDAT.
|
ENDAT.
|
||||||
ENDLOOP.
|
ENDLOOP.
|
||||||
|
|
||||||
|
@ -386,7 +386,7 @@ CLASS ZCL_ABAPGIT_GUI_PAGE_STAGE IMPLEMENTATION.
|
||||||
is_file = <ls_remote> ) ).
|
is_file = <ls_remote> ) ).
|
||||||
|
|
||||||
AT LAST.
|
AT LAST.
|
||||||
ro_html->add('</tbody>').
|
ro_html->add( '</tbody>' ).
|
||||||
ENDAT.
|
ENDAT.
|
||||||
ENDLOOP.
|
ENDLOOP.
|
||||||
|
|
||||||
|
|
|
@ -177,7 +177,7 @@ CLASS ZCL_ABAPGIT_REPO IMPLEMENTATION.
|
||||||
deserialize_checks( ).
|
deserialize_checks( ).
|
||||||
|
|
||||||
IF is_checks-requirements-met = 'N' AND is_checks-requirements-decision IS INITIAL.
|
IF is_checks-requirements-met = 'N' AND is_checks-requirements-decision IS INITIAL.
|
||||||
zcx_abapgit_exception=>raise( 'Requirements not met and undecided ').
|
zcx_abapgit_exception=>raise( 'Requirements not met and undecided' ).
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
|
||||||
IF is_checks-transport-required = abap_true AND is_checks-transport-transport IS INITIAL.
|
IF is_checks-transport-required = abap_true AND is_checks-transport-transport IS INITIAL.
|
||||||
|
|
|
@ -337,7 +337,7 @@ CLASS ltcl_transport_objects IMPLEMENTATION.
|
||||||
|
|
||||||
TRY.
|
TRY.
|
||||||
when_staging( ).
|
when_staging( ).
|
||||||
cl_abap_unit_assert=>fail( 'Should have raised exception').
|
cl_abap_unit_assert=>fail( 'Should have raised exception' ).
|
||||||
CATCH zcx_abapgit_exception INTO lx_exception.
|
CATCH zcx_abapgit_exception INTO lx_exception.
|
||||||
cl_abap_unit_assert=>assert_equals(
|
cl_abap_unit_assert=>assert_equals(
|
||||||
act = lx_exception->get_text( )
|
act = lx_exception->get_text( )
|
||||||
|
|
Loading…
Reference in New Issue
Block a user