diff --git a/compileruntime/containerLine_lib_standard/src/main/js/test/ArrayList.test.js b/compileruntime/containerLine_lib_standard/src/main/js/test/ArrayList.test.js index 52076df774e461e5eea90b57c3f5281f58702003..12e5df40ebae05101e6d4052d119f4fd507d9dee 100644 --- a/compileruntime/containerLine_lib_standard/src/main/js/test/ArrayList.test.js +++ b/compileruntime/containerLine_lib_standard/src/main/js/test/ArrayList.test.js @@ -533,8 +533,8 @@ describe("ArraylistTest", function () { arrayList.removeByRange(0, 9); let res = arrayList.length; let res1 = arrayList.getLastIndexOf(1); - expect(res).assertEqual(1); - expect(res1).assertEqual(0); + expect(res).assertEqual(0); + expect(res1).assertEqual(-1); }); it("SR000GGR44_testSubArrayList040", 0, function () { let arrayList = new ArrayList(); @@ -702,4 +702,20 @@ describe("ArraylistTest", function () { expect(arr[i]).assertEqual(a[i]); } }); + it("SR000GGR44_testRemoveByRange052", 0, function () { + let arrayList = new ArrayList(); + arrayList.add("四"); + arrayList.add("三"); + arrayList.add(1); + arrayList.add("a"); + arrayList.add(1); + arrayList.add("b"); + arrayList.add("c"); + arrayList.add(1); + arrayList.removeByRange(0, 8); + let res = arrayList.length; + let res1 = arrayList.getLastIndexOf(1); + expect(res).assertEqual(1); + expect(res1).assertEqual(0); + }); }); diff --git a/compileruntime/containerLine_lib_standard/src/main/js/test/Vector.test.js b/compileruntime/containerLine_lib_standard/src/main/js/test/Vector.test.js index e96f3f85c89f0f9b7cd00d0ec3879a3c723eb563..021d481b86f7ed1cbcb65779a0cc0dfe712d6717 100644 --- a/compileruntime/containerLine_lib_standard/src/main/js/test/Vector.test.js +++ b/compileruntime/containerLine_lib_standard/src/main/js/test/Vector.test.js @@ -534,7 +534,7 @@ describe("VectorTest", function () { vector.add(14); let arr1 = ["a", "b", "c"]; vector.copyToArray(arr1); - let a = ["a", "b", "c",4, 3, 1]; + let a = ["a", "b", "c", 4, 3, 1]; for (let i = 0; i < a.length; i++) { expect(arr1[i]).assertEqual(a[i]); } diff --git a/compileruntime/containerRelation_lib_standard/src/main/js/test/PlainArray.test.js b/compileruntime/containerRelation_lib_standard/src/main/js/test/PlainArray.test.js index 1f4143c4964609a75c3d102f53f34cdc3c0992e7..cf9d816041e2eef553f90738d2c2c217653e6546 100644 --- a/compileruntime/containerRelation_lib_standard/src/main/js/test/PlainArray.test.js +++ b/compileruntime/containerRelation_lib_standard/src/main/js/test/PlainArray.test.js @@ -459,7 +459,6 @@ describe("PlainArrayTest", function () { }); it("SR000GGR45_testAdd039", 0, function () { let plainArray = new PlainArray(); - plainArray.add(1.23, "a"); plainArray.add(-2, "b"); try { plainArray.add("a", "c"); @@ -501,4 +500,16 @@ describe("PlainArrayTest", function () { } expect(flag).assertEqual(true); }); + it("SR000GGR45_testAdd042", 0, function () { + let plainArray = new PlainArray(); + plainArray.add(-2, "b"); + try { + plainArray.add(1.23, "a"); + } catch (err) { + expect(err.name).assertEqual("TypeError"); + expect(err.message).assertEqual("the index is not integer"); + } + let res = plainArray.get(-2); + expect(res).assertEqual("b"); + }); });