add missing spaces (#1984)

* add missing spaces

* plus change the approach for this unit test
This commit is contained in:
Lars Hvam 2018-10-02 16:08:43 +02:00 committed by GitHub
parent ef956b9486
commit f8075e77d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 78 additions and 84 deletions

View File

@ -26,8 +26,6 @@ CLASS ltcl_calculate_patch DEFINITION FINAL FOR TESTING
unknown_result_type FOR TESTING RAISING cx_static_check.
METHODS:
setup,
given_diff
IMPORTING
iv_patch_flag TYPE zif_abapgit_definitions=>ty_diff-patch_flag
@ -49,7 +47,6 @@ CLASS ltcl_calculate_patch DEFINITION FINAL FOR TESTING
DATA:
mt_diff TYPE zif_abapgit_definitions=>ty_diffs_tt,
mt_patch TYPE stringtab,
mv_index TYPE sytabix,
mx_error TYPE REF TO zcx_abapgit_exception.
ENDCLASS.
@ -57,12 +54,6 @@ ENDCLASS.
CLASS ltcl_calculate_patch IMPLEMENTATION.
METHOD setup.
mv_index = 0.
ENDMETHOD.
DEFINE given_diff.
given_diff( iv_patch_flag = &1
@ -84,10 +75,10 @@ CLASS ltcl_calculate_patch IMPLEMENTATION.
when_patch_is_calculated( ).
then_patch_should_be(:
' ' ),
'write: `Test`.' ),
' ' ).
then_patch_should_be(
|\n| &&
|write: `Test`.\n| &&
|\n| ).
ENDMETHOD.
@ -102,11 +93,11 @@ CLASS ltcl_calculate_patch IMPLEMENTATION.
when_patch_is_calculated( ).
then_patch_should_be(:
' ' ),
'write: `Test`.' ),
'write: `Hello world`.' ),
' ' ).
then_patch_should_be(
|\n| &&
|write: `Test`.\n| &&
|write: `Hello world`.\n| &&
|\n| ).
ENDMETHOD.
@ -122,12 +113,12 @@ CLASS ltcl_calculate_patch IMPLEMENTATION.
when_patch_is_calculated( ).
then_patch_should_be(:
' ' ),
'write: `Test`.' ),
' ' ),
'write: `Hello world`.' ),
' ' ).
then_patch_should_be(
|\n| &&
|write: `Test`.\n| &&
|\n| &&
|write: `Hello world`.\n| &&
|\n| ).
ENDMETHOD.
@ -143,11 +134,11 @@ CLASS ltcl_calculate_patch IMPLEMENTATION.
when_patch_is_calculated( ).
then_patch_should_be(:
' ' ),
'write: `Test`.' ),
' ' ),
' ' ).
then_patch_should_be(
|\n| &&
|write: `Test`.\n| &&
|\n| &&
|\n| ).
ENDMETHOD.
@ -161,9 +152,7 @@ CLASS ltcl_calculate_patch IMPLEMENTATION.
when_patch_is_calculated( ).
then_patch_should_be(:
' ' ),
' ' ).
then_patch_should_be( |\n\n| ).
ENDMETHOD.
@ -178,9 +167,7 @@ CLASS ltcl_calculate_patch IMPLEMENTATION.
when_patch_is_calculated( ).
then_patch_should_be(:
' ' ),
' ' ).
then_patch_should_be( |\n\n| ).
ENDMETHOD.
@ -196,10 +183,10 @@ CLASS ltcl_calculate_patch IMPLEMENTATION.
when_patch_is_calculated( ).
then_patch_should_be(:
' ' ),
'write: `Hello world`.' ),
' ' ).
then_patch_should_be(
|\n| &&
|write: `Hello world`.| &&
|\n| ).
ENDMETHOD.
@ -216,10 +203,11 @@ CLASS ltcl_calculate_patch IMPLEMENTATION.
when_patch_is_calculated( ).
then_patch_should_be( ' ' ).
then_patch_should_be( 'write: `Hello world`.' ).
then_patch_should_be( 'write: `Hello 123`.' ).
then_patch_should_be( ' ' ).
then_patch_should_be(
|\n| &&
|write: `Hello world`.\n| &&
|write: `Hello 123`.\n| &&
|\n| ).
ENDMETHOD.
@ -233,10 +221,10 @@ CLASS ltcl_calculate_patch IMPLEMENTATION.
when_patch_is_calculated( ).
then_patch_should_be(:
' ' ),
'write: `Hello world`.' ),
' ' ).
then_patch_should_be(
|\n| &&
|write: `Hello world`.\n| &&
|\n| ).
ENDMETHOD.
@ -251,11 +239,11 @@ CLASS ltcl_calculate_patch IMPLEMENTATION.
when_patch_is_calculated( ).
then_patch_should_be(:
' ' ),
'write: `Hello world`.' ),
'write: `Test`.' ),
' ' ).
then_patch_should_be(
|\n| &&
|write: `Hello world`.\n| &&
|write: `Test`.\n| &&
|\n| ).
ENDMETHOD.
@ -271,12 +259,12 @@ CLASS ltcl_calculate_patch IMPLEMENTATION.
when_patch_is_calculated( ).
then_patch_should_be(:
' ' ),
'write: `Hello world`.' ),
' ' ),
'write: `Test`.' ),
' ' ).
then_patch_should_be(
|\n| &&
|write: `Hello world`.\n| &&
|\n| &&
|write: `Test`.\n| &&
|\n| ).
ENDMETHOD.
@ -292,12 +280,12 @@ CLASS ltcl_calculate_patch IMPLEMENTATION.
when_patch_is_calculated( ).
then_patch_should_be(:
' ' ),
'write: `Hello world`.' ),
' ' ),
'write: `Hello world`.' ),
' ' ).
then_patch_should_be(
|\n| &&
|write: `Hello world`.\n| &&
|\n| &&
|write: `Hello world`.\n| &&
|\n| ).
ENDMETHOD.
@ -314,13 +302,13 @@ CLASS ltcl_calculate_patch IMPLEMENTATION.
when_patch_is_calculated( ).
then_patch_should_be(:
' ' ),
'write: `Hello world`.' ),
' ' ),
'write: `Hello world`.' ),
' ' ),
'write: `newline`.' ).
then_patch_should_be(
|\n| &&
|write: `Hello world`.\n| &&
|\n| &&
|write: `Hello world`.\n| &&
|\n| &&
|write: `newline`.\n| ).
ENDMETHOD.
@ -372,16 +360,22 @@ CLASS ltcl_calculate_patch IMPLEMENTATION.
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
ASSIGNING <ls_patch>.
SPLIT iv_exp_patch AT |\n| INTO TABLE lt_patch IN CHARACTER MODE.
cl_abap_unit_assert=>assert_equals(
exp = iv_exp_patch
act = <ls_patch> ).
LOOP AT lt_patch INTO lv_patch.
READ TABLE mt_patch INDEX sy-tabix ASSIGNING <lv_patch>.
cl_abap_unit_assert=>assert_subrc( ).
cl_abap_unit_assert=>assert_equals(
exp = lv_patch
act = <lv_patch> ).
ENDLOOP.
ENDMETHOD.

View File

@ -273,8 +273,8 @@ CLASS ZCL_ABAPGIT_GUI_PAGE_COMMIT IMPLEMENTATION.
ro_html->add( '<table class="stage_tab">' ).
ro_html->add( '<thead>' ).
ro_html->add( '<tr>').
ro_html->add( '<th colspan="2">Staged files</th>').
ro_html->add( '<tr>' ).
ro_html->add( '<th colspan="2">Staged files</th>' ).
ro_html->add( '</tr>' ).
ro_html->add( '</thead>' ).

View File

@ -363,7 +363,7 @@ CLASS ZCL_ABAPGIT_GUI_PAGE_STAGE IMPLEMENTATION.
iv_changed_by = ls_changed_by-name ) ).
AT LAST.
ro_html->add('</tbody>').
ro_html->add( '</tbody>' ).
ENDAT.
ENDLOOP.
@ -386,7 +386,7 @@ CLASS ZCL_ABAPGIT_GUI_PAGE_STAGE IMPLEMENTATION.
is_file = <ls_remote> ) ).
AT LAST.
ro_html->add('</tbody>').
ro_html->add( '</tbody>' ).
ENDAT.
ENDLOOP.

View File

@ -177,7 +177,7 @@ CLASS ZCL_ABAPGIT_REPO IMPLEMENTATION.
deserialize_checks( ).
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.
IF is_checks-transport-required = abap_true AND is_checks-transport-transport IS INITIAL.

View File

@ -337,7 +337,7 @@ CLASS ltcl_transport_objects IMPLEMENTATION.
TRY.
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.
cl_abap_unit_assert=>assert_equals(
act = lx_exception->get_text( )