mirror of
https://github.com/abapGit/abapGit.git
synced 2025-05-01 12:20:51 +08:00

* Issue 2424 https://github.com/abapGit/abapGit/issues/2424 * Issue 2424 https://github.com/abapGit/abapGit/issues/2424 * Update src/objects/zcl_abapgit_object_fugr.clas.abap Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com> * Fixing LINT issues * Fixing LINT issues * TABL, default ROWORCOLST on deserialize (#4430) (#4) * Fix for #4425 * Remove whitespace at end of line Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com> * Remove whitespace at end of line Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com> Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com> Co-authored-by: DerGuteWolf <DerGuteWolf@users.noreply.github.com> Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com> * Centralize LXE functionality * Fix FUGR LXE * delete issue reference comments * Delete issue reference comments * Remove Aliases for LXE types * Review Changes * Copy from #4452 Integrate changes from #4452 into #4415 Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com> Co-authored-by: Lars Hvam <larshp@hotmail.com> Co-authored-by: DerGuteWolf <DerGuteWolf@users.noreply.github.com> Co-authored-by: Sebastian Koitka <sebastian.koitka@dematic.com> Co-authored-by: Marc Bernard <marc@marcbernardtools.com> Co-authored-by: Marc Bernard <59966492+mbtools@users.noreply.github.com>
104 lines
3.3 KiB
ABAP
104 lines
3.3 KiB
ABAP
CLASS ltcl_dot_abapgit DEFINITION DEFERRED.
|
|
CLASS zcl_abapgit_dot_abapgit DEFINITION LOCAL FRIENDS ltcl_dot_abapgit.
|
|
|
|
CLASS ltcl_dot_abapgit DEFINITION FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
|
|
|
PRIVATE SECTION.
|
|
METHODS:
|
|
identity FOR TESTING
|
|
RAISING zcx_abapgit_exception,
|
|
ignore FOR TESTING.
|
|
|
|
ENDCLASS.
|
|
|
|
CLASS ltcl_dot_abapgit IMPLEMENTATION.
|
|
|
|
METHOD identity.
|
|
|
|
DATA: lo_dot TYPE REF TO zcl_abapgit_dot_abapgit,
|
|
ls_before TYPE zif_abapgit_dot_abapgit=>ty_dot_abapgit,
|
|
ls_after TYPE zif_abapgit_dot_abapgit=>ty_dot_abapgit.
|
|
|
|
|
|
lo_dot = zcl_abapgit_dot_abapgit=>build_default( ).
|
|
ls_before = lo_dot->ms_data.
|
|
|
|
lo_dot = zcl_abapgit_dot_abapgit=>deserialize( lo_dot->serialize( ) ).
|
|
ls_after = lo_dot->ms_data.
|
|
|
|
cl_abap_unit_assert=>assert_equals(
|
|
act = ls_after
|
|
exp = ls_before ).
|
|
|
|
ENDMETHOD.
|
|
|
|
METHOD ignore.
|
|
|
|
CONSTANTS: lc_path TYPE string VALUE '/src/',
|
|
lc_root TYPE string VALUE '/',
|
|
lc_filename TYPE string VALUE 'foobar.txt'.
|
|
|
|
DATA: lv_ignored TYPE abap_bool,
|
|
lo_dot TYPE REF TO zcl_abapgit_dot_abapgit.
|
|
|
|
|
|
lo_dot = zcl_abapgit_dot_abapgit=>build_default( ).
|
|
|
|
" Any file in default starting folder /src/ should not be ignored
|
|
lv_ignored = lo_dot->is_ignored( iv_path = lc_path
|
|
iv_filename = lc_filename ).
|
|
cl_abap_unit_assert=>assert_equals(
|
|
act = lv_ignored
|
|
exp = abap_false ).
|
|
|
|
" Add file to ignore list -> expect to be ignored
|
|
lo_dot->add_ignore( iv_path = lc_path
|
|
iv_filename = lc_filename ).
|
|
|
|
lv_ignored = lo_dot->is_ignored( iv_path = lc_path
|
|
iv_filename = lc_filename ).
|
|
cl_abap_unit_assert=>assert_equals(
|
|
act = lv_ignored
|
|
exp = abap_true ).
|
|
|
|
" Remove file from ignore list -> expect to be allowed
|
|
lo_dot->remove_ignore( iv_path = lc_path
|
|
iv_filename = lc_filename ).
|
|
|
|
lv_ignored = lo_dot->is_ignored( iv_path = lc_path
|
|
iv_filename = lc_filename ).
|
|
cl_abap_unit_assert=>assert_equals(
|
|
act = lv_ignored
|
|
exp = abap_false ).
|
|
|
|
" .abapgit.xml and .apack-manifest.xml must always be allowed
|
|
lv_ignored = lo_dot->is_ignored( iv_path = lc_root
|
|
iv_filename = zif_abapgit_definitions=>c_dot_abapgit ).
|
|
cl_abap_unit_assert=>assert_equals(
|
|
act = lv_ignored
|
|
exp = abap_false ).
|
|
|
|
lv_ignored = lo_dot->is_ignored( iv_path = lc_root
|
|
iv_filename = zif_abapgit_apack_definitions=>c_dot_apack_manifest ).
|
|
cl_abap_unit_assert=>assert_equals(
|
|
act = lv_ignored
|
|
exp = abap_false ).
|
|
|
|
" File in root must be ignored since it's not under starting folder
|
|
lv_ignored = lo_dot->is_ignored( iv_path = lc_root
|
|
iv_filename = 'abaplint.json' ).
|
|
cl_abap_unit_assert=>assert_equals(
|
|
act = lv_ignored
|
|
exp = abap_true ).
|
|
|
|
" File under starting folder must not be ignored
|
|
lv_ignored = lo_dot->is_ignored( iv_path = lc_path
|
|
iv_filename = 'ztest.prog.abap' ).
|
|
cl_abap_unit_assert=>assert_equals(
|
|
act = lv_ignored
|
|
exp = abap_false ).
|
|
|
|
ENDMETHOD.
|
|
|
|
ENDCLASS.
|