Missing objects in overwrite confirmation popup (#3558)

* Missing objects in overwrite confirmation popup

Closes https://github.com/larshp/abapGit/issues/3550

* Unit tests

Co-authored-by: Lars Hvam <larshp@hotmail.com>
This commit is contained in:
Marc Bernard 2020-07-04 09:31:21 +02:00 committed by GitHub
parent 493bb969b2
commit 9d29fe57ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 56 additions and 2 deletions

View File

@ -899,7 +899,8 @@ CLASS ZCL_ABAPGIT_OBJECTS IMPLEMENTATION.
SORT rt_results
BY obj_type ASCENDING
obj_name ASCENDING
rstate DESCENDING. " ensures that non-empty rstate is kept
rstate DESCENDING " ensures that non-empty rstate is kept
lstate DESCENDING. " ensures that non-empty lstate is kept
DELETE ADJACENT DUPLICATES FROM rt_results COMPARING obj_type obj_name.
ENDMETHOD.
@ -1100,7 +1101,7 @@ CLASS ZCL_ABAPGIT_OBJECTS IMPLEMENTATION.
APPEND <ls_result> TO rt_results.
ENDLOOP.
* TOBJ has to be handled before ODSO
* TOBJ has to be handled before SCP1
LOOP AT it_results ASSIGNING <ls_result> WHERE obj_type = 'TOBJ'.
APPEND <ls_result> TO rt_results.
ENDLOOP.

View File

@ -553,6 +553,8 @@ CLASS ltcl_filter_files_to_deser DEFINITION FINAL FOR TESTING
filter_duplicates_lstate FOR TESTING RAISING cx_static_check,
filter_duplicates_match FOR TESTING RAISING cx_static_check,
filter_duplicates_init_objtype FOR TESTING RAISING cx_static_check,
filter_duplicates_changes_01 FOR TESTING RAISING cx_static_check,
filter_duplicates_changes_02 FOR TESTING RAISING cx_static_check,
given_result
IMPORTING
@ -652,6 +654,57 @@ CLASS ltcl_filter_files_to_deser IMPLEMENTATION.
ENDMETHOD.
METHOD filter_duplicates_changes_01.
DATA: ls_exp LIKE LINE OF mt_result,
ls_act LIKE LINE OF mt_result.
" test different order since SORT object,obj_name is non-deterministic
given_result( |CLAS;ZAG_UNIT_TEST;;/src/;zag_unit_test.clas.abap;;;M;M| ).
given_result( |CLAS;ZAG_UNIT_TEST;;/src/;zag_unit_test.clas.testclasses.abap;;;;M| ).
READ TABLE mt_result INDEX 1 INTO ls_exp.
when_filter_is_applied( ).
cl_abap_unit_assert=>assert_equals(
exp = 1
act = lines( mt_result ) ).
READ TABLE mt_result INDEX 1 INTO ls_act.
" expect M,M
cl_abap_unit_assert=>assert_equals(
exp = ls_exp
act = ls_act ).
ENDMETHOD.
METHOD filter_duplicates_changes_02.
DATA: ls_exp LIKE LINE OF mt_result,
ls_act LIKE LINE OF mt_result.
" test different order since SORT object,obj_name is non-deterministic
given_result( |CLAS;ZAG_UNIT_TEST;;/src/;zag_unit_test.clas.abap;;;;M| ).
given_result( |CLAS;ZAG_UNIT_TEST;;/src/;zag_unit_test.clas.testclasses.abap;;;M;M| ).
READ TABLE mt_result INDEX 2 INTO ls_exp.
when_filter_is_applied( ).
cl_abap_unit_assert=>assert_equals(
exp = 1
act = lines( mt_result ) ).
READ TABLE mt_result INDEX 1 INTO ls_act.
" expect M,M
cl_abap_unit_assert=>assert_equals(
exp = ls_exp
act = ls_act ).
ENDMETHOD.
METHOD given_result.