All files / output zcl_abapgit_dot_abapgit.clas.testclasses.mjs

58.06% Statements 54/93
83.33% Branches 5/6
80% Functions 4/5
58.06% Lines 54/93

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 931x 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_dot_abapgit} = await import("./zcl_abapgit_dot_abapgit.clas.mjs");
const {cx_root} = await import("./cx_root.clas.mjs");
// zcl_abapgit_dot_abapgit.clas.testclasses.abap
class ltcl_dot_abapgit {
  static INTERNAL_TYPE = 'CLAS';
  static INTERNAL_NAME = 'CLAS-ZCL_ABAPGIT_DOT_ABAPGIT-LTCL_DOT_ABAPGIT';
  static IMPLEMENTED_INTERFACES = [];
  static ATTRIBUTES = {};
  static METHODS = {"IDENTITY": {"visibility": "I", "parameters": {}},
  "IGNORE": {"visibility": "I", "parameters": {}}};
  constructor() {
    this.me = new abap.types.ABAPObject();
    this.me.set(this);
    this.INTERNAL_ID = abap.internalIdCounter++;
    this.FRIENDS_ACCESS_INSTANCE = {
      "identity": this.#identity.bind(this),
      "ignore": this.#ignore.bind(this),
    };
  }
  async constructor_(INPUT) {
    if (super.constructor_) { await super.constructor_(INPUT); }
    return this;
  }
  async #identity() {
    let lo_dot = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_DOT_ABAPGIT", RTTIName: "\\CLASS=ZCL_ABAPGIT_DOT_ABAPGIT"});
    let ls_before = new abap.types.Structure({
    "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_DOT_ABAPGIT=>TY_DOT_ABAPGIT-NAME"}),
    "master_language": new abap.types.Character(1, {"qualifiedName":"SPRAS","ddicName":"SPRAS","description":"SPRAS"}),
    "i18n_languages": abap.types.TableFactory.construct(new abap.types.Character(2, {"qualifiedName":"LAISO","ddicName":"LAISO","description":"LAISO"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_definitions=>ty_languages"),
    "use_lxe": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}),
    "without_translation": abap.types.TableFactory.construct(new abap.types.String({qualifiedName: "STRING"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_dot_abapgit=>ty_dot_abapgit-without_translation"),
    "starting_folder": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_DOT_ABAPGIT=>TY_DOT_ABAPGIT-STARTING_FOLDER"}),
    "folder_logic": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_DOT_ABAPGIT=>TY_DOT_ABAPGIT-FOLDER_LOGIC"}),
    "ignore": abap.types.TableFactory.construct(new abap.types.String({qualifiedName: "STRING"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_dot_abapgit=>ty_dot_abapgit-ignore"),
    "requirements": abap.types.TableFactory.construct(new abap.types.Structure({
    "component": new abap.types.Character(30, {"description":"DLVUNIT"}),
    "min_release": new abap.types.Character(10, {"qualifiedName":"SAPRELEASE","ddicName":"SAPRELEASE","description":"SAPRELEASE"}),
    "min_patch": new abap.types.Character(10, {"qualifiedName":"SAPPATCHLV","ddicName":"SAPPATCHLV","description":"SAPPATCHLV"})}, "zif_abapgit_dot_abapgit=>ty_requirement", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_dot_abapgit=>ty_requirement_tt"),
    "version_constant": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_DOT_ABAPGIT=>TY_DOT_ABAPGIT-VERSION_CONSTANT"}),
    "abap_language_version": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_DOT_ABAPGIT=>TY_DOT_ABAPGIT-ABAP_LANGUAGE_VERSION"}),
    "original_system": new abap.types.Character(5, {})}, "zif_abapgit_dot_abapgit=>ty_dot_abapgit", undefined, {}, {});
    let ls_after = new abap.types.Structure({
    "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_DOT_ABAPGIT=>TY_DOT_ABAPGIT-NAME"}),
    "master_language": new abap.types.Character(1, {"qualifiedName":"SPRAS","ddicName":"SPRAS","description":"SPRAS"}),
    "i18n_languages": abap.types.TableFactory.construct(new abap.types.Character(2, {"qualifiedName":"LAISO","ddicName":"LAISO","description":"LAISO"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_definitions=>ty_languages"),
    "use_lxe": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}),
    "without_translation": abap.types.TableFactory.construct(new abap.types.String({qualifiedName: "STRING"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_dot_abapgit=>ty_dot_abapgit-without_translation"),
    "starting_folder": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_DOT_ABAPGIT=>TY_DOT_ABAPGIT-STARTING_FOLDER"}),
    "folder_logic": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_DOT_ABAPGIT=>TY_DOT_ABAPGIT-FOLDER_LOGIC"}),
    "ignore": abap.types.TableFactory.construct(new abap.types.String({qualifiedName: "STRING"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_dot_abapgit=>ty_dot_abapgit-ignore"),
    "requirements": abap.types.TableFactory.construct(new abap.types.Structure({
    "component": new abap.types.Character(30, {"description":"DLVUNIT"}),
    "min_release": new abap.types.Character(10, {"qualifiedName":"SAPRELEASE","ddicName":"SAPRELEASE","description":"SAPRELEASE"}),
    "min_patch": new abap.types.Character(10, {"qualifiedName":"SAPPATCHLV","ddicName":"SAPPATCHLV","description":"SAPPATCHLV"})}, "zif_abapgit_dot_abapgit=>ty_requirement", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_dot_abapgit=>ty_requirement_tt"),
    "version_constant": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_DOT_ABAPGIT=>TY_DOT_ABAPGIT-VERSION_CONSTANT"}),
    "abap_language_version": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_DOT_ABAPGIT=>TY_DOT_ABAPGIT-ABAP_LANGUAGE_VERSION"}),
    "original_system": new abap.types.Character(5, {})}, "zif_abapgit_dot_abapgit=>ty_dot_abapgit", undefined, {}, {});
    lo_dot.set((await abap.Classes['ZCL_ABAPGIT_DOT_ABAPGIT'].build_default()));
    ls_before.set((await lo_dot.get().get_data()));
    lo_dot.set((await abap.Classes['ZCL_ABAPGIT_DOT_ABAPGIT'].deserialize({iv_xstr: (await lo_dot.get().serialize())})));
    ls_after.set((await lo_dot.get().get_data()));
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: ls_after, exp: ls_before});
  }
  async #ignore() {
    let lc_path = new abap.types.String({qualifiedName: "STRING"});
    lc_path.set('/src/');
    let lc_root = new abap.types.String({qualifiedName: "STRING"});
    lc_root.set('/');
    let lc_filename = new abap.types.String({qualifiedName: "STRING"});
    lc_filename.set('foobar.txt');
    let lv_ignored = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});
    let lo_dot = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_DOT_ABAPGIT", RTTIName: "\\CLASS=ZCL_ABAPGIT_DOT_ABAPGIT"});
    lo_dot.set((await abap.Classes['ZCL_ABAPGIT_DOT_ABAPGIT'].build_default()));
    lv_ignored.set((await lo_dot.get().is_ignored({iv_path: lc_path, iv_filename: lc_filename})));
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: lv_ignored, exp: abap.builtin.abap_false});
    await lo_dot.get().add_ignore({iv_path: lc_path, iv_filename: lc_filename});
    lv_ignored.set((await lo_dot.get().is_ignored({iv_path: lc_path, iv_filename: lc_filename})));
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: lv_ignored, exp: abap.builtin.abap_true});
    await lo_dot.get().remove_ignore({iv_path: lc_path, iv_filename: lc_filename});
    lv_ignored.set((await lo_dot.get().is_ignored({iv_path: lc_path, iv_filename: lc_filename})));
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: lv_ignored, exp: abap.builtin.abap_false});
    lv_ignored.set((await lo_dot.get().is_ignored({iv_path: lc_root, iv_filename: abap.Classes['ZIF_ABAPGIT_DEFINITIONS'].zif_abapgit_definitions$c_dot_abapgit})));
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: lv_ignored, exp: abap.builtin.abap_false});
    lv_ignored.set((await lo_dot.get().is_ignored({iv_path: lc_root, iv_filename: abap.Classes['ZIF_ABAPGIT_APACK_DEFINITIONS'].zif_abapgit_apack_definitions$c_dot_apack_manifest})));
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: lv_ignored, exp: abap.builtin.abap_false});
    lv_ignored.set((await lo_dot.get().is_ignored({iv_path: lc_root, iv_filename: abap.CharacterFactory.get(13, 'abaplint.json')})));
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: lv_ignored, exp: abap.builtin.abap_true});
    lv_ignored.set((await lo_dot.get().is_ignored({iv_path: lc_path, iv_filename: abap.CharacterFactory.get(15, 'ztest.prog.abap')})));
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: lv_ignored, exp: abap.builtin.abap_false});
  }
}
abap.Classes['CLAS-ZCL_ABAPGIT_DOT_ABAPGIT-LTCL_DOT_ABAPGIT'] = ltcl_dot_abapgit;
export {ltcl_dot_abapgit};