All files / output zcl_abapgit_zlib_huffman.clas.testclasses.mjs

100% Statements 80/80
91.66% Branches 11/12
100% Functions 5/5
100% Lines 80/80

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 801x 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 10x 10x 10x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 144x 144x 144x 1x 1x 1x 1x 112x 112x 112x 1x 1x 1x 1x 24x 24x 24x 1x 1x 1x 1x 8x 8x 8x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x
const {zcl_abapgit_zlib_huffman} = await import("./zcl_abapgit_zlib_huffman.clas.mjs");
const {cx_root} = await import("./cx_root.clas.mjs");
// zcl_abapgit_zlib_huffman.clas.testclasses.abap
class ltcl_test {
  static STATIC_SUPER = undefined;
  static INTERNAL_TYPE = 'CLAS';
  static INTERNAL_NAME = 'CLAS-ZCL_ABAPGIT_ZLIB_HUFFMAN-LTCL_TEST';
  static IMPLEMENTED_INTERFACES = [];
  static ATTRIBUTES = {};
  static METHODS = {"CREATE1": {"visibility": "I", "parameters": {}},
  "CREATE2": {"visibility": "I", "parameters": {}}};
  constructor() {
    this.me = new abap.types.ABAPObject();
    this.me.set(this);
    this.INTERNAL_ID = abap.internalIdCounter++;
    this.FRIENDS_ACCESS_INSTANCE = {
      "create1": this.#create1.bind(this),
      "create2": this.#create2.bind(this),
    };
  }
  async constructor_(INPUT) {
    if (super.constructor_) { await super.constructor_(INPUT); }
    return this;
  }
  async #create1() {
    let lo_huffman = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_ZLIB_HUFFMAN", RTTIName: "\\CLASS=ZCL_ABAPGIT_ZLIB_HUFFMAN"});
    let lt_lengths = abap.types.TableFactory.construct(new abap.types.Integer({qualifiedName: "I"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zcl_abapgit_zlib_huffman=>ty_lengths");
    const indexBackup1 = abap.builtin.sy.get().index.get();
    const unique479 = abap.IntegerFactory.get(10).get();
    for (let unique480 = 0; unique480 < unique479; unique480++) {
      abap.builtin.sy.get().index.set(unique480 + 1);
      abap.statements.append({source: abap.IntegerFactory.get(8), target: lt_lengths});
    }
    abap.builtin.sy.get().index.set(indexBackup1);
    lo_huffman.set(await (new abap.Classes['ZCL_ABAPGIT_ZLIB_HUFFMAN']()).constructor_({it_lengths: lt_lengths}));
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: (await lo_huffman.get().get_count({iv_index: abap.IntegerFactory.get(1)})), exp: abap.IntegerFactory.get(0)});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: (await lo_huffman.get().get_count({iv_index: abap.IntegerFactory.get(8)})), exp: abap.IntegerFactory.get(10)});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: (await lo_huffman.get().get_symbol({iv_index: abap.IntegerFactory.get(1)})), exp: abap.IntegerFactory.get(0)});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: (await lo_huffman.get().get_symbol({iv_index: abap.IntegerFactory.get(10)})), exp: abap.IntegerFactory.get(9)});
  }
  async #create2() {
    let lo_huffman = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_ZLIB_HUFFMAN", RTTIName: "\\CLASS=ZCL_ABAPGIT_ZLIB_HUFFMAN"});
    let lt_lengths = abap.types.TableFactory.construct(new abap.types.Integer({qualifiedName: "I"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zcl_abapgit_zlib_huffman=>ty_lengths");
    const indexBackup1 = abap.builtin.sy.get().index.get();
    const unique481 = abap.IntegerFactory.get(144).get();
    for (let unique482 = 0; unique482 < unique481; unique482++) {
      abap.builtin.sy.get().index.set(unique482 + 1);
      abap.statements.append({source: abap.IntegerFactory.get(8), target: lt_lengths});
    }
    abap.builtin.sy.get().index.set(indexBackup1);
    const indexBackup2 = abap.builtin.sy.get().index.get();
    const unique483 = abap.IntegerFactory.get(112).get();
    for (let unique484 = 0; unique484 < unique483; unique484++) {
      abap.builtin.sy.get().index.set(unique484 + 1);
      abap.statements.append({source: abap.IntegerFactory.get(9), target: lt_lengths});
    }
    abap.builtin.sy.get().index.set(indexBackup2);
    const indexBackup3 = abap.builtin.sy.get().index.get();
    const unique485 = abap.IntegerFactory.get(24).get();
    for (let unique486 = 0; unique486 < unique485; unique486++) {
      abap.builtin.sy.get().index.set(unique486 + 1);
      abap.statements.append({source: abap.IntegerFactory.get(7), target: lt_lengths});
    }
    abap.builtin.sy.get().index.set(indexBackup3);
    const indexBackup4 = abap.builtin.sy.get().index.get();
    const unique487 = abap.IntegerFactory.get(8).get();
    for (let unique488 = 0; unique488 < unique487; unique488++) {
      abap.builtin.sy.get().index.set(unique488 + 1);
      abap.statements.append({source: abap.IntegerFactory.get(8), target: lt_lengths});
    }
    abap.builtin.sy.get().index.set(indexBackup4);
    lo_huffman.set(await (new abap.Classes['ZCL_ABAPGIT_ZLIB_HUFFMAN']()).constructor_({it_lengths: lt_lengths}));
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: (await lo_huffman.get().get_count({iv_index: abap.IntegerFactory.get(8)})), exp: abap.IntegerFactory.get(152)});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: (await lo_huffman.get().get_count({iv_index: abap.IntegerFactory.get(15)})), exp: abap.IntegerFactory.get(0)});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: (await lo_huffman.get().get_symbol({iv_index: abap.IntegerFactory.get(1)})), exp: new abap.types.Integer().set(256)});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: (await lo_huffman.get().get_symbol({iv_index: new abap.types.Integer().set(288)})), exp: new abap.types.Integer().set(255)});
  }
}
abap.Classes['CLAS-ZCL_ABAPGIT_ZLIB_HUFFMAN-LTCL_TEST'] = ltcl_test;
export {ltcl_test};