All files / output zcl_abapgit_objects_program.clas.testclasses.mjs

100% Statements 111/111
85.71% Branches 6/7
100% Functions 5/5
100% Lines 111/111

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 1111x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 2x 2x 2x 2x 2x 2x 2x 2x 1x 2x 2x 2x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x
const {zcl_abapgit_objects_super} = await import("./zcl_abapgit_objects_super.clas.mjs");
const {zcl_abapgit_objects_program} = await import("./zcl_abapgit_objects_program.clas.mjs");
const {cx_root} = await import("./cx_root.clas.mjs");
// zcl_abapgit_objects_program.clas.testclasses.abap
 
class ltcl_test {
  static INTERNAL_TYPE = 'CLAS';
  static INTERNAL_NAME = 'CLAS-ZCL_ABAPGIT_OBJECTS_PROGRAM-LTCL_TEST';
  static IMPLEMENTED_INTERFACES = [];
  static ATTRIBUTES = {};
  static METHODS = {"STRIP_GENERATION_COMMENTS_1": {"visibility": "I", "parameters": {}},
  "STRIP_GENERATION_COMMENTS_2": {"visibility": "I", "parameters": {}}};
  constructor() {
    this.me = new abap.types.ABAPObject();
    this.me.set(this);
    this.INTERNAL_ID = abap.internalIdCounter++;
    this.FRIENDS_ACCESS_INSTANCE = {
      "strip_generation_comments_1": this.#strip_generation_comments_1.bind(this),
      "strip_generation_comments_2": this.#strip_generation_comments_2.bind(this),
    };
  }
  async constructor_(INPUT) {
    if (super.constructor_) { await super.constructor_(INPUT); }
    return this;
  }
  async #strip_generation_comments_1() {
    let lo_cut = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_OBJECTS_PROGRAM", RTTIName: "\\CLASS=ZCL_ABAPGIT_OBJECTS_PROGRAM"});
    let ls_item = new abap.types.Structure({
    "obj_type": new abap.types.Character(4, {}),
    "obj_name": new abap.types.Character(40, {}),
    "devclass": new abap.types.Character(30, {"qualifiedName":"DEVCLASS","ddicName":"DEVCLASS","description":"DEVCLASS"}),
    "srcsystem": new abap.types.Character(5, {}),
    "origlang": new abap.types.Character(1, {}),
    "inactive": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}),
    "abap_language_version": new abap.types.Character(1, {"qualifiedName":"zif_abapgit_aff_types_v1=>ty_abap_language_version"})}, "zif_abapgit_definitions=>ty_item", undefined, {}, {});
    let lt_src_orig = abap.types.TableFactory.construct(new abap.types.Structure({
    "line": new abap.types.Character(255, {"qualifiedName":"TEXT255","ddicName":"TEXT255","description":"Text"})}, "ABAPTXT255", "ABAPTXT255", {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"isUnique":false,"type":"STANDARD","keyFields":[],"name":"primary_key"},"secondary":[]}, "ABAPTXT255_TAB");
    let lt_src_act = abap.types.TableFactory.construct(new abap.types.Structure({
    "line": new abap.types.Character(255, {"qualifiedName":"TEXT255","ddicName":"TEXT255","description":"Text"})}, "ABAPTXT255", "ABAPTXT255", {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"isUnique":false,"type":"STANDARD","keyFields":[],"name":"primary_key"},"secondary":[]}, "ABAPTXT255_TAB");
    let lt_src_exp = abap.types.TableFactory.construct(new abap.types.Structure({
    "line": new abap.types.Character(255, {"qualifiedName":"TEXT255","ddicName":"TEXT255","description":"Text"})}, "ABAPTXT255", "ABAPTXT255", {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"isUnique":false,"type":"STANDARD","keyFields":[],"name":"primary_key"},"secondary":[]}, "ABAPTXT255_TAB");
    abap.statements.append({source: abap.CharacterFactory.get(71, '*---------------------------------------------------------------------*'), target: lt_src_orig});
    abap.statements.append({source: abap.CharacterFactory.get(35, '*    view related data declarations'), target: lt_src_orig});
    abap.statements.append({source: abap.CharacterFactory.get(43, '*   generation date: 03.02.2022 at 13:19:02'), target: lt_src_orig});
    abap.statements.append({source: abap.CharacterFactory.get(48, '*   view maintenance generator version: #001407#'), target: lt_src_orig});
    abap.statements.append({source: abap.CharacterFactory.get(71, '*---------------------------------------------------------------------*'), target: lt_src_orig});
    abap.statements.append({source: abap.CharacterFactory.get(21, 'some code starts here'), target: lt_src_orig});
    abap.statements.append({source: abap.CharacterFactory.get(71, '*---------------------------------------------------------------------*'), target: lt_src_exp});
    abap.statements.append({source: abap.CharacterFactory.get(35, '*    view related data declarations'), target: lt_src_exp});
    abap.statements.append({source: abap.CharacterFactory.get(71, '*---------------------------------------------------------------------*'), target: lt_src_exp});
    abap.statements.append({source: abap.CharacterFactory.get(21, 'some code starts here'), target: lt_src_exp});
    ls_item.get().obj_type.set(abap.CharacterFactory.get(4, 'PROG'));
    lo_cut.set(await (new abap.Classes['ZCL_ABAPGIT_OBJECTS_PROGRAM']()).constructor_({iv_language: abap.CharacterFactory.get(1, 'E'), is_item: ls_item}));
    lt_src_act.set(lt_src_orig);
    await lo_cut.get().strip_generation_comments({ct_source: lt_src_act});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: lt_src_act, exp: lt_src_orig});
    ls_item.get().obj_type.set(abap.CharacterFactory.get(4, 'FUGR'));
    lo_cut.set(await (new abap.Classes['ZCL_ABAPGIT_OBJECTS_PROGRAM']()).constructor_({iv_language: abap.CharacterFactory.get(1, 'E'), is_item: ls_item}));
    lt_src_act.set(lt_src_orig);
    await lo_cut.get().strip_generation_comments({ct_source: lt_src_act});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: lt_src_act, exp: lt_src_exp});
    lt_src_orig.clear();
    abap.statements.append({source: abap.CharacterFactory.get(71, '*---------------------------------------------------------------------*'), target: lt_src_orig});
    abap.statements.append({source: abap.CharacterFactory.get(12, '* extra line'), target: lt_src_orig});
    abap.statements.append({source: abap.CharacterFactory.get(35, '*    view related data declarations'), target: lt_src_orig});
    abap.statements.append({source: abap.CharacterFactory.get(43, '*   generation date: 03.02.2022 at 13:19:02'), target: lt_src_orig});
    abap.statements.append({source: abap.CharacterFactory.get(48, '*   view maintenance generator version: #001407#'), target: lt_src_orig});
    abap.statements.append({source: abap.CharacterFactory.get(71, '*---------------------------------------------------------------------*'), target: lt_src_orig});
    abap.statements.append({source: abap.CharacterFactory.get(21, 'some code starts here'), target: lt_src_orig});
    ls_item.get().obj_type.set(abap.CharacterFactory.get(4, 'FUGR'));
    lo_cut.set(await (new abap.Classes['ZCL_ABAPGIT_OBJECTS_PROGRAM']()).constructor_({iv_language: abap.CharacterFactory.get(1, 'E'), is_item: ls_item}));
    lt_src_act.set(lt_src_orig);
    await lo_cut.get().strip_generation_comments({ct_source: lt_src_act});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: lt_src_act, exp: lt_src_orig});
  }
  async #strip_generation_comments_2() {
    let lo_cut = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_OBJECTS_PROGRAM", RTTIName: "\\CLASS=ZCL_ABAPGIT_OBJECTS_PROGRAM"});
    let ls_item = new abap.types.Structure({
    "obj_type": new abap.types.Character(4, {}),
    "obj_name": new abap.types.Character(40, {}),
    "devclass": new abap.types.Character(30, {"qualifiedName":"DEVCLASS","ddicName":"DEVCLASS","description":"DEVCLASS"}),
    "srcsystem": new abap.types.Character(5, {}),
    "origlang": new abap.types.Character(1, {}),
    "inactive": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}),
    "abap_language_version": new abap.types.Character(1, {"qualifiedName":"zif_abapgit_aff_types_v1=>ty_abap_language_version"})}, "zif_abapgit_definitions=>ty_item", undefined, {}, {});
    let lt_src_orig = abap.types.TableFactory.construct(new abap.types.Structure({
    "line": new abap.types.Character(255, {"qualifiedName":"TEXT255","ddicName":"TEXT255","description":"Text"})}, "ABAPTXT255", "ABAPTXT255", {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"isUnique":false,"type":"STANDARD","keyFields":[],"name":"primary_key"},"secondary":[]}, "ABAPTXT255_TAB");
    let lt_src_act = abap.types.TableFactory.construct(new abap.types.Structure({
    "line": new abap.types.Character(255, {"qualifiedName":"TEXT255","ddicName":"TEXT255","description":"Text"})}, "ABAPTXT255", "ABAPTXT255", {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"isUnique":false,"type":"STANDARD","keyFields":[],"name":"primary_key"},"secondary":[]}, "ABAPTXT255_TAB");
    let lt_src_exp = abap.types.TableFactory.construct(new abap.types.Structure({
    "line": new abap.types.Character(255, {"qualifiedName":"TEXT255","ddicName":"TEXT255","description":"Text"})}, "ABAPTXT255", "ABAPTXT255", {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"isUnique":false,"type":"STANDARD","keyFields":[],"name":"primary_key"},"secondary":[]}, "ABAPTXT255_TAB");
    abap.statements.append({source: abap.CharacterFactory.get(36, '* regenerated at 06.06.2022 10:47:40'), target: lt_src_orig});
    abap.statements.append({source: abap.CharacterFactory.get(11, 'some code 1'), target: lt_src_orig});
    abap.statements.append({source: abap.CharacterFactory.get(11, 'some code 2'), target: lt_src_orig});
    abap.statements.append({source: abap.CharacterFactory.get(11, 'some code 3'), target: lt_src_orig});
    abap.statements.append({source: abap.CharacterFactory.get(11, 'some code 4'), target: lt_src_orig});
    abap.statements.append({source: abap.CharacterFactory.get(11, 'some code 5'), target: lt_src_orig});
    abap.statements.append({source: abap.CharacterFactory.get(11, 'some code 1'), target: lt_src_exp});
    abap.statements.append({source: abap.CharacterFactory.get(11, 'some code 2'), target: lt_src_exp});
    abap.statements.append({source: abap.CharacterFactory.get(11, 'some code 3'), target: lt_src_exp});
    abap.statements.append({source: abap.CharacterFactory.get(11, 'some code 4'), target: lt_src_exp});
    abap.statements.append({source: abap.CharacterFactory.get(11, 'some code 5'), target: lt_src_exp});
    ls_item.get().obj_type.set(abap.CharacterFactory.get(4, 'FUGR'));
    lo_cut.set(await (new abap.Classes['ZCL_ABAPGIT_OBJECTS_PROGRAM']()).constructor_({iv_language: abap.CharacterFactory.get(1, 'E'), is_item: ls_item}));
    lt_src_act.set(lt_src_orig);
    await lo_cut.get().strip_generation_comments({ct_source: lt_src_act});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: lt_src_act, exp: lt_src_exp});
  }
}
abap.Classes['CLAS-ZCL_ABAPGIT_OBJECTS_PROGRAM-LTCL_TEST'] = ltcl_test;
export {ltcl_test};