All files / output zcl_abapgit_zlib_stream.clas.testclasses.mjs

100% Statements 41/41
83.33% Branches 5/6
100% Functions 4/4
100% Lines 41/41

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 411x 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_zlib_stream} = await import("./zcl_abapgit_zlib_stream.clas.mjs");
const {cx_root} = await import("./cx_root.clas.mjs");
// zcl_abapgit_zlib_stream.clas.testclasses.abap
class ltcl_test {
  static STATIC_SUPER = undefined;
  static INTERNAL_TYPE = 'CLAS';
  static INTERNAL_NAME = 'CLAS-ZCL_ABAPGIT_ZLIB_STREAM-LTCL_TEST';
  static IMPLEMENTED_INTERFACES = [];
  static ATTRIBUTES = {};
  static METHODS = {"TEST": {"visibility": "I", "parameters": {}}};
  constructor() {
    this.me = new abap.types.ABAPObject();
    this.me.set(this);
    this.INTERNAL_ID = abap.internalIdCounter++;
    this.FRIENDS_ACCESS_INSTANCE = {
      "test": this.#test.bind(this),
    };
  }
  async constructor_(INPUT) {
    if (super.constructor_) { await super.constructor_(INPUT); }
    return this;
  }
  async #test() {
    let lo_stream = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_ZLIB_STREAM", RTTIName: "\\CLASS=ZCL_ABAPGIT_ZLIB_STREAM"});
    let lv_remaining = new abap.types.Integer({qualifiedName: "I"});
    let lv_int = new abap.types.Integer({qualifiedName: "I"});
    let lv_bits = new abap.types.String({qualifiedName: "STRING"});
    let lv_bytes = new abap.types.XString({qualifiedName: "XSTRING"});
    lo_stream.set(await (new abap.Classes['ZCL_ABAPGIT_ZLIB_STREAM']()).constructor_({iv_data: abap.CharacterFactory.get(12, '112233445566')}));
    lv_bits.set((await lo_stream.get().take_bits({iv_length: abap.IntegerFactory.get(8)})));
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: lv_bits, exp: abap.CharacterFactory.get(8, '00010001')});
    lv_remaining.set((await lo_stream.get().remaining()));
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: lv_remaining, exp: abap.IntegerFactory.get(6)});
    lv_int.set((await lo_stream.get().take_int({iv_length: abap.IntegerFactory.get(8)})));
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: lv_int, exp: abap.IntegerFactory.get(34)});
    lv_bytes.set((await lo_stream.get().take_bytes({iv_length: abap.IntegerFactory.get(2)})));
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: lv_bytes, exp: abap.CharacterFactory.get(4, '3344')});
  }
}
abap.Classes['CLAS-ZCL_ABAPGIT_ZLIB_STREAM-LTCL_TEST'] = ltcl_test;
export {ltcl_test};