All files / output zcl_abapgit_git_delta.clas.testclasses.mjs

99.12% Statements 227/229
87.5% Branches 21/24
100% Functions 19/19
99.12% Lines 227/229

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 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 2291x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 3x 3x 3x 3x 3x 3x 3x 3x 3x 1x 3x 3x 3x 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 2x 2x     2x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 1x 10x 10x 10x 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 1x 1x 1x 1x 1x 1x 1x
const {zcl_abapgit_git_delta} = await import("./zcl_abapgit_git_delta.clas.mjs");
const {lcl_stream} = await import("./zcl_abapgit_git_delta.clas.locals.mjs");
await import("./zcl_abapgit_git_delta.clas.locals.mjs");
const {cx_root} = await import("./cx_root.clas.mjs");
// zcl_abapgit_git_delta.clas.testclasses.abap
class ltcl_git_delta_test {
  static STATIC_SUPER = undefined;
  static INTERNAL_TYPE = 'CLAS';
  static INTERNAL_NAME = 'CLAS-ZCL_ABAPGIT_GIT_DELTA-LTCL_GIT_DELTA_TEST';
  static IMPLEMENTED_INTERFACES = [];
  static ATTRIBUTES = {};
  static METHODS = {"TEST_DECODE_DELTAS_EMPTY": {"visibility": "I", "parameters": {}},
  "TEST_DECODE_DELTAS_NO_DELTA": {"visibility": "I", "parameters": {}},
  "TEST_DECODE_DELTAS_SUCCESS": {"visibility": "I", "parameters": {}}};
  constructor() {
    this.me = new abap.types.ABAPObject();
    this.me.set(this);
    this.INTERNAL_ID = abap.internalIdCounter++;
    this.FRIENDS_ACCESS_INSTANCE = {
      "test_decode_deltas_empty": this.#test_decode_deltas_empty.bind(this),
      "test_decode_deltas_no_delta": this.#test_decode_deltas_no_delta.bind(this),
      "test_decode_deltas_success": this.#test_decode_deltas_success.bind(this),
    };
  }
  async constructor_(INPUT) {
    if (super.constructor_) { await super.constructor_(INPUT); }
    return this;
  }
  async #test_decode_deltas_empty() {
    let lt_objects = abap.types.TableFactory.construct(new abap.types.Structure({
    "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
    "type": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_git_definitions=>ty_type"}),
    "data": new abap.types.XString({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_OBJECT-DATA"}),
    "adler32": new abap.types.Hex({length: 4}),
    "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_OBJECT-INDEX"})}, "zif_abapgit_definitions=>ty_object", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[{"name":"sha","type":"SORTED","isUnique":false,"keyFields":["SHA1"]},{"name":"type","type":"SORTED","isUnique":false,"keyFields":["TYPE","SHA1"]}]}, "zif_abapgit_definitions=>ty_objects_tt");
    await abap.Classes['ZCL_ABAPGIT_GIT_DELTA'].decode_deltas({iv_show_progress: abap.builtin.abap_false, ct_objects: lt_objects});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: abap.builtin.lines({val: lt_objects}), exp: abap.IntegerFactory.get(0), msg: abap.CharacterFactory.get(38, 'Empty object table should remain empty')});
  }
  async #test_decode_deltas_no_delta() {
    let lt_objects = abap.types.TableFactory.construct(new abap.types.Structure({
    "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
    "type": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_git_definitions=>ty_type"}),
    "data": new abap.types.XString({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_OBJECT-DATA"}),
    "adler32": new abap.types.Hex({length: 4}),
    "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_OBJECT-INDEX"})}, "zif_abapgit_definitions=>ty_object", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[{"name":"sha","type":"SORTED","isUnique":false,"keyFields":["SHA1"]},{"name":"type","type":"SORTED","isUnique":false,"keyFields":["TYPE","SHA1"]}]}, "zif_abapgit_definitions=>ty_objects_tt");
    let ls_object = new abap.types.Structure({
    "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
    "type": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_git_definitions=>ty_type"}),
    "data": new abap.types.XString({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_OBJECT-DATA"}),
    "adler32": new abap.types.Hex({length: 4}),
    "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_OBJECT-INDEX"})}, "zif_abapgit_definitions=>ty_object", undefined, {}, {});
    ls_object.get().sha1.set(abap.CharacterFactory.get(40, '1234567890123456789012345678901234567890'));
    ls_object.get().type.set(abap.Classes['ZIF_ABAPGIT_GIT_DEFINITIONS'].zif_abapgit_git_definitions$c_type.get().blob);
    ls_object.get().data.set((await abap.Classes['ZCL_ABAPGIT_CONVERT'].string_to_xstring_utf8({iv_string: new abap.types.String().set(`Hello World`)})));
    ls_object.get().index.set(abap.IntegerFactory.get(1));
    abap.statements.append({source: ls_object, target: lt_objects});
    await abap.Classes['ZCL_ABAPGIT_GIT_DELTA'].decode_deltas({iv_show_progress: abap.builtin.abap_false, ct_objects: lt_objects});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: abap.builtin.lines({val: lt_objects}), exp: abap.IntegerFactory.get(1), msg: abap.CharacterFactory.get(41, 'Non-delta objects should remain unchanged')});
    abap.statements.readTable(lt_objects,{index: abap.IntegerFactory.get(1),
      into: ls_object});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: ls_object.get().type, exp: abap.Classes['ZIF_ABAPGIT_GIT_DEFINITIONS'].zif_abapgit_git_definitions$c_type.get().blob, msg: abap.CharacterFactory.get(30, 'Object type should remain blob')});
  }
  async #test_decode_deltas_success() {
    let lt_objects = abap.types.TableFactory.construct(new abap.types.Structure({
    "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
    "type": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_git_definitions=>ty_type"}),
    "data": new abap.types.XString({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_OBJECT-DATA"}),
    "adler32": new abap.types.Hex({length: 4}),
    "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_OBJECT-INDEX"})}, "zif_abapgit_definitions=>ty_object", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[{"name":"sha","type":"SORTED","isUnique":false,"keyFields":["SHA1"]},{"name":"type","type":"SORTED","isUnique":false,"keyFields":["TYPE","SHA1"]}]}, "zif_abapgit_definitions=>ty_objects_tt");
    let lv_original_count = new abap.types.Integer({qualifiedName: "I"});
    let ls_object = new abap.types.Structure({
    "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
    "type": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_git_definitions=>ty_type"}),
    "data": new abap.types.XString({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_OBJECT-DATA"}),
    "adler32": new abap.types.Hex({length: 4}),
    "index": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_OBJECT-INDEX"})}, "zif_abapgit_definitions=>ty_object", undefined, {}, {});
    ls_object.get().sha1.set(abap.CharacterFactory.get(40, '1234567890123456789012345678901234567890'));
    ls_object.get().type.set(abap.Classes['ZIF_ABAPGIT_GIT_DEFINITIONS'].zif_abapgit_git_definitions$c_type.get().blob);
    ls_object.get().data.set((await abap.Classes['ZCL_ABAPGIT_CONVERT'].string_to_xstring_utf8({iv_string: new abap.types.String().set(`Hello World`)})));
    ls_object.get().index.set(abap.IntegerFactory.get(1));
    abap.statements.append({source: ls_object, target: lt_objects});
    ls_object.clear();
    ls_object.get().sha1.set(abap.CharacterFactory.get(40, '1234567890123456789012345678901234567890'));
    ls_object.get().type.set(abap.Classes['ZIF_ABAPGIT_GIT_DEFINITIONS'].zif_abapgit_git_definitions$c_type.get().ref_d);
    ls_object.get().data.set(abap.CharacterFactory.get(8, '0B0D900B'));
    ls_object.get().index.set(abap.IntegerFactory.get(2));
    abap.statements.append({source: ls_object, target: lt_objects});
    lv_original_count.set(abap.builtin.lines({val: lt_objects}));
    await abap.Classes['ZCL_ABAPGIT_GIT_DELTA'].decode_deltas({iv_show_progress: abap.builtin.abap_false, ct_objects: lt_objects});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: abap.builtin.lines({val: lt_objects}), exp: lv_original_count, msg: abap.CharacterFactory.get(57, 'Should have same number of objects after delta processing')});
    for await (const unique399 of abap.statements.loop(lt_objects)) {
      ls_object.set(unique399);
      if (abap.compare.eq(ls_object.get().type, abap.Classes['ZIF_ABAPGIT_GIT_DEFINITIONS'].zif_abapgit_git_definitions$c_type.get().ref_d)) {
        await abap.Classes['CL_ABAP_UNIT_ASSERT'].fail({msg: abap.CharacterFactory.get(47, 'No delta objects should remain after processing')});
      }
    }
  }
}
abap.Classes['CLAS-ZCL_ABAPGIT_GIT_DELTA-LTCL_GIT_DELTA_TEST'] = ltcl_git_delta_test;
class ltcl_stream_test {
  static STATIC_SUPER = undefined;
  static INTERNAL_TYPE = 'CLAS';
  static INTERNAL_NAME = 'CLAS-ZCL_ABAPGIT_GIT_DELTA-LTCL_STREAM_TEST';
  static IMPLEMENTED_INTERFACES = [];
  static ATTRIBUTES = {};
  static METHODS = {"TEST_OFFSET_ONLY_1BYTE": {"visibility": "I", "parameters": {}},
  "TEST_OFFSET_ONLY_2BYTES": {"visibility": "I", "parameters": {}},
  "TEST_OFFSET_ONLY_4BYTES": {"visibility": "I", "parameters": {}},
  "TEST_LENGTH_ONLY_1BYTE": {"visibility": "I", "parameters": {}},
  "TEST_LENGTH_ONLY_2BYTES": {"visibility": "I", "parameters": {}},
  "TEST_LENGTH_ONLY_3BYTES": {"visibility": "I", "parameters": {}},
  "TEST_LENGTH_ZERO_DEFAULT": {"visibility": "I", "parameters": {}},
  "TEST_OFFSET_AND_LENGTH": {"visibility": "I", "parameters": {}},
  "TEST_ALL_BITS_SET": {"visibility": "I", "parameters": {}},
  "TEST_NO_BITS_SET": {"visibility": "I", "parameters": {}}};
  constructor() {
    this.me = new abap.types.ABAPObject();
    this.me.set(this);
    this.INTERNAL_ID = abap.internalIdCounter++;
    this.FRIENDS_ACCESS_INSTANCE = {
      "test_offset_only_1byte": this.#test_offset_only_1byte.bind(this),
      "test_offset_only_2bytes": this.#test_offset_only_2bytes.bind(this),
      "test_offset_only_4bytes": this.#test_offset_only_4bytes.bind(this),
      "test_length_only_1byte": this.#test_length_only_1byte.bind(this),
      "test_length_only_2bytes": this.#test_length_only_2bytes.bind(this),
      "test_length_only_3bytes": this.#test_length_only_3bytes.bind(this),
      "test_length_zero_default": this.#test_length_zero_default.bind(this),
      "test_offset_and_length": this.#test_offset_and_length.bind(this),
      "test_all_bits_set": this.#test_all_bits_set.bind(this),
      "test_no_bits_set": this.#test_no_bits_set.bind(this),
    };
  }
  async constructor_(INPUT) {
    if (super.constructor_) { await super.constructor_(INPUT); }
    return this;
  }
  async #test_offset_only_1byte() {
    let lo_stream = new abap.types.ABAPObject({qualifiedName: "LCL_STREAM", RTTIName: "\\CLASS-POOL=ZCL_ABAPGIT_GIT_DELTA\\CLASS=LCL_STREAM"});
    let lv_offset = new abap.types.Integer({qualifiedName: "I"});
    let lv_length = new abap.types.Integer({qualifiedName: "I"});
    lo_stream.set(await (new abap.Classes['CLAS-ZCL_ABAPGIT_GIT_DELTA-LCL_STREAM']()).constructor_({iv_data: abap.CharacterFactory.get(2, 'FF')}));
    await lo_stream.get().eat_offset_and_length({iv_instruction: abap.CharacterFactory.get(2, '01'), ev_offset: lv_offset, ev_length: lv_length});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: lv_offset, exp: new abap.types.Integer().set(255), msg: abap.CharacterFactory.get(20, 'Offset should be 255')});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: lv_length, exp: new abap.types.Integer().set(65536), msg: abap.CharacterFactory.get(30, 'Length should default to 65536')});
  }
  async #test_offset_only_2bytes() {
    let lo_stream = new abap.types.ABAPObject({qualifiedName: "LCL_STREAM", RTTIName: "\\CLASS-POOL=ZCL_ABAPGIT_GIT_DELTA\\CLASS=LCL_STREAM"});
    let lv_offset = new abap.types.Integer({qualifiedName: "I"});
    let lv_length = new abap.types.Integer({qualifiedName: "I"});
    lo_stream.set(await (new abap.Classes['CLAS-ZCL_ABAPGIT_GIT_DELTA-LCL_STREAM']()).constructor_({iv_data: abap.CharacterFactory.get(4, '0102')}));
    await lo_stream.get().eat_offset_and_length({iv_instruction: abap.CharacterFactory.get(2, '03'), ev_offset: lv_offset, ev_length: lv_length});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: lv_offset, exp: new abap.types.Integer().set(513), msg: abap.CharacterFactory.get(20, 'Offset should be 513')});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: lv_length, exp: new abap.types.Integer().set(65536), msg: abap.CharacterFactory.get(30, 'Length should default to 65536')});
  }
  async #test_offset_only_4bytes() {
    let lo_stream = new abap.types.ABAPObject({qualifiedName: "LCL_STREAM", RTTIName: "\\CLASS-POOL=ZCL_ABAPGIT_GIT_DELTA\\CLASS=LCL_STREAM"});
    let lv_offset = new abap.types.Integer({qualifiedName: "I"});
    let lv_length = new abap.types.Integer({qualifiedName: "I"});
    lo_stream.set(await (new abap.Classes['CLAS-ZCL_ABAPGIT_GIT_DELTA-LCL_STREAM']()).constructor_({iv_data: abap.CharacterFactory.get(8, '01020304')}));
    await lo_stream.get().eat_offset_and_length({iv_instruction: abap.CharacterFactory.get(2, '0F'), ev_offset: lv_offset, ev_length: lv_length});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: lv_offset, exp: new abap.types.Integer().set(67305985), msg: abap.CharacterFactory.get(25, 'Offset should be 67305985')});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: lv_length, exp: new abap.types.Integer().set(65536), msg: abap.CharacterFactory.get(30, 'Length should default to 65536')});
  }
  async #test_length_only_1byte() {
    let lo_stream = new abap.types.ABAPObject({qualifiedName: "LCL_STREAM", RTTIName: "\\CLASS-POOL=ZCL_ABAPGIT_GIT_DELTA\\CLASS=LCL_STREAM"});
    let lv_offset = new abap.types.Integer({qualifiedName: "I"});
    let lv_length = new abap.types.Integer({qualifiedName: "I"});
    lo_stream.set(await (new abap.Classes['CLAS-ZCL_ABAPGIT_GIT_DELTA-LCL_STREAM']()).constructor_({iv_data: abap.CharacterFactory.get(2, '0A')}));
    await lo_stream.get().eat_offset_and_length({iv_instruction: abap.CharacterFactory.get(2, '10'), ev_offset: lv_offset, ev_length: lv_length});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: lv_offset, exp: abap.IntegerFactory.get(0), msg: abap.CharacterFactory.get(18, 'Offset should be 0')});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: lv_length, exp: abap.IntegerFactory.get(10), msg: abap.CharacterFactory.get(19, 'Length should be 10')});
  }
  async #test_length_only_2bytes() {
    let lo_stream = new abap.types.ABAPObject({qualifiedName: "LCL_STREAM", RTTIName: "\\CLASS-POOL=ZCL_ABAPGIT_GIT_DELTA\\CLASS=LCL_STREAM"});
    let lv_offset = new abap.types.Integer({qualifiedName: "I"});
    let lv_length = new abap.types.Integer({qualifiedName: "I"});
    lo_stream.set(await (new abap.Classes['CLAS-ZCL_ABAPGIT_GIT_DELTA-LCL_STREAM']()).constructor_({iv_data: abap.CharacterFactory.get(4, '0102')}));
    await lo_stream.get().eat_offset_and_length({iv_instruction: abap.CharacterFactory.get(2, '30'), ev_offset: lv_offset, ev_length: lv_length});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: lv_offset, exp: abap.IntegerFactory.get(0), msg: abap.CharacterFactory.get(18, 'Offset should be 0')});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: lv_length, exp: new abap.types.Integer().set(513), msg: abap.CharacterFactory.get(20, 'Length should be 513')});
  }
  async #test_length_only_3bytes() {
    let lo_stream = new abap.types.ABAPObject({qualifiedName: "LCL_STREAM", RTTIName: "\\CLASS-POOL=ZCL_ABAPGIT_GIT_DELTA\\CLASS=LCL_STREAM"});
    let lv_offset = new abap.types.Integer({qualifiedName: "I"});
    let lv_length = new abap.types.Integer({qualifiedName: "I"});
    lo_stream.set(await (new abap.Classes['CLAS-ZCL_ABAPGIT_GIT_DELTA-LCL_STREAM']()).constructor_({iv_data: abap.CharacterFactory.get(6, '010203')}));
    await lo_stream.get().eat_offset_and_length({iv_instruction: abap.CharacterFactory.get(2, '70'), ev_offset: lv_offset, ev_length: lv_length});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: lv_offset, exp: abap.IntegerFactory.get(0), msg: abap.CharacterFactory.get(18, 'Offset should be 0')});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: lv_length, exp: new abap.types.Integer().set(197121), msg: abap.CharacterFactory.get(23, 'Length should be 197121')});
  }
  async #test_length_zero_default() {
    let lo_stream = new abap.types.ABAPObject({qualifiedName: "LCL_STREAM", RTTIName: "\\CLASS-POOL=ZCL_ABAPGIT_GIT_DELTA\\CLASS=LCL_STREAM"});
    let lv_offset = new abap.types.Integer({qualifiedName: "I"});
    let lv_length = new abap.types.Integer({qualifiedName: "I"});
    lo_stream.set(await (new abap.Classes['CLAS-ZCL_ABAPGIT_GIT_DELTA-LCL_STREAM']()).constructor_({iv_data: abap.CharacterFactory.get(2, '00')}));
    await lo_stream.get().eat_offset_and_length({iv_instruction: abap.CharacterFactory.get(2, '00'), ev_offset: lv_offset, ev_length: lv_length});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: lv_offset, exp: abap.IntegerFactory.get(0), msg: abap.CharacterFactory.get(18, 'Offset should be 0')});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: lv_length, exp: new abap.types.Integer().set(65536), msg: abap.CharacterFactory.get(30, 'Length should default to 65536')});
  }
  async #test_offset_and_length() {
    let lo_stream = new abap.types.ABAPObject({qualifiedName: "LCL_STREAM", RTTIName: "\\CLASS-POOL=ZCL_ABAPGIT_GIT_DELTA\\CLASS=LCL_STREAM"});
    let lv_offset = new abap.types.Integer({qualifiedName: "I"});
    let lv_length = new abap.types.Integer({qualifiedName: "I"});
    lo_stream.set(await (new abap.Classes['CLAS-ZCL_ABAPGIT_GIT_DELTA-LCL_STREAM']()).constructor_({iv_data: abap.CharacterFactory.get(4, '0A14')}));
    await lo_stream.get().eat_offset_and_length({iv_instruction: abap.CharacterFactory.get(2, '11'), ev_offset: lv_offset, ev_length: lv_length});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: lv_offset, exp: abap.IntegerFactory.get(10), msg: abap.CharacterFactory.get(19, 'Offset should be 10')});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: lv_length, exp: abap.IntegerFactory.get(20), msg: abap.CharacterFactory.get(19, 'Length should be 20')});
  }
  async #test_all_bits_set() {
    let lo_stream = new abap.types.ABAPObject({qualifiedName: "LCL_STREAM", RTTIName: "\\CLASS-POOL=ZCL_ABAPGIT_GIT_DELTA\\CLASS=LCL_STREAM"});
    let lv_offset = new abap.types.Integer({qualifiedName: "I"});
    let lv_length = new abap.types.Integer({qualifiedName: "I"});
    lo_stream.set(await (new abap.Classes['CLAS-ZCL_ABAPGIT_GIT_DELTA-LCL_STREAM']()).constructor_({iv_data: abap.CharacterFactory.get(14, '01020304050607')}));
    await lo_stream.get().eat_offset_and_length({iv_instruction: abap.CharacterFactory.get(2, '7F'), ev_offset: lv_offset, ev_length: lv_length});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: lv_offset, exp: new abap.types.Integer().set(67305985), msg: abap.CharacterFactory.get(25, 'Offset should be 67305985')});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: lv_length, exp: new abap.types.Integer().set(460293), msg: abap.CharacterFactory.get(23, 'Length should be 460293')});
  }
  async #test_no_bits_set() {
    let lo_stream = new abap.types.ABAPObject({qualifiedName: "LCL_STREAM", RTTIName: "\\CLASS-POOL=ZCL_ABAPGIT_GIT_DELTA\\CLASS=LCL_STREAM"});
    let lv_offset = new abap.types.Integer({qualifiedName: "I"});
    let lv_length = new abap.types.Integer({qualifiedName: "I"});
    lo_stream.set(await (new abap.Classes['CLAS-ZCL_ABAPGIT_GIT_DELTA-LCL_STREAM']()).constructor_({iv_data: abap.CharacterFactory.get(2, '00')}));
    await lo_stream.get().eat_offset_and_length({iv_instruction: abap.CharacterFactory.get(2, '80'), ev_offset: lv_offset, ev_length: lv_length});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: lv_offset, exp: abap.IntegerFactory.get(0), msg: abap.CharacterFactory.get(18, 'Offset should be 0')});
    await abap.Classes['CL_ABAP_UNIT_ASSERT'].assert_equals({act: lv_length, exp: new abap.types.Integer().set(65536), msg: abap.CharacterFactory.get(30, 'Length should default to 65536')});
  }
}
abap.Classes['CLAS-ZCL_ABAPGIT_GIT_DELTA-LTCL_STREAM_TEST'] = ltcl_stream_test;
export {ltcl_git_delta_test, ltcl_stream_test};