未验证 提交 d20b514c 编写于 作者: O openharmony_ci 提交者: Gitee

!2204 Add Containers XTS Tests

Merge pull request !2204 from 刘甘霖/master
......@@ -17,6 +17,8 @@ group("compileruntime") {
if (is_standard_system) {
deps = [
"ark_intl_standard/intljs:intljs_test",
"containerLine_lib_standard:containerLine_js_test",
"containerRelation_lib_standard:containerRelation_js_test",
"convertxml_lib_standard:convertxml_js_test",
"uri_lib_standard:uri_js_test",
"url_lib_standard:url_js_test",
......
# Copyright (C) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("containerLine_js_test") {
hap_profile = "./src/main/config.json"
js2abc = true
deps = [
":containerLine_js_assets",
":containerLine_resources",
]
# shared_libraries = [
# "//third_party/giflib:libgif",
# "//third_party/libpng:libpng",
# ]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsContainerLineJsTest"
# part_name = "prebuilt_hap"
# subsystem_name = "xts"
}
ohos_js_assets("containerLine_js_assets") {
source_dir = "./src/main/js/default"
}
ohos_resources("containerLine_resources") {
sources = [ "./src/main/resources" ]
hap_profile = "./src/main/config.json"
}
{
"description": "Configuration for startup util js api Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "300000",
"package": "com.example.containerLine",
"shell-timeout": "60000"
},
"kits": [
{
"test-file-name": [
"ActsContainerLineJsTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
\ No newline at end of file
{
"app": {
"bundleName": "com.example.containerLine",
"vendor": "example",
"version": {
"code": 1000000,
"name": "1.0.0"
},
"apiVersion": {
"compatible": 4,
"target": 5
}
},
"deviceConfig": {},
"module": {
"package": "com.example.containerLine",
"name": ".MyApplication",
"mainAbility": "com.example.containerLine.MainAbility",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry",
"installationFree": false
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"visible": true,
"name": "com.example.containerLine.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:entry_MainAbility",
"type": "page",
"launchType": "standard"
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": true
}
}
]
}
}
\ No newline at end of file
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export default {
onCreate() {
console.info('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
}
};
{
"strings": {
"hello": "Hello",
"world": "World"
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
}
}
\ No newline at end of file
.container {
flex-direction: column;
justify-content: center;
align-items: center;
}
.title {
font-size: 40px;
color: #000000;
opacity: 0.9;
}
@media screen and (device-type: tablet) and (orientation: landscape) {
.title {
font-size: 100px;
}
}
@media screen and (device-type: wearable) {
.title {
font-size: 28px;
color: #FFFFFF;
}
}
@media screen and (device-type: tv) {
.container {
background-image: url("../../common/images/Wallpaper.png");
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
.title {
font-size: 100px;
color: #FFFFFF;
}
}
@media screen and (device-type: phone) and (orientation: landscape) {
.title {
font-size: 60px;
}
}
<div class="container" onswipe="touchMove">
<text class="title">
{{ $t('strings.hello') }} {{title}}
</text>
</div>
\ No newline at end of file
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import file from '@system.file'
import app from '@system.app'
import device from '@system.device'
import router from '@system.router'
import {Core} from 'deccjsunit/index'
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
},
onShow() {
console.info('onShow finish')
const core = Core.getInstance()
core.init()
require('../../../test/Main.test')
core.execute()
},
onReady() {
},
}
\ No newline at end of file
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the 'License')
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index';
import Deque from "@ohos.util.Deque";
describe("DequeTest", function () {
it("SR000GGR3K_testConstructor001", 0, function () {
try {
let deque = new Deque();
} catch (err) {
expect(err).assertEqual("Error:Cannot create new deque");
}
});
it("SR000GGR3K_testInsertFront001", 0, function () {
let deque = new Deque();
deque.insertFront("");
let res = deque.getFirst();
expect(res).assertEqual("");
});
it("SR000GGR3K_testInsertFront002", 0, function () {
let deque = new Deque();
deque.insertFront(8);
let res = deque.getFirst();
expect(res).assertEqual(8);
});
it("SR000GGR3K_testInsertFront003", 0, function () {
let deque = new Deque();
let a = {name: "lala", age: "15"};
deque.insertFront(a);
let res = deque.getFirst();
expect(res).assertEqual(a);
});
it("SR000GGR3K_testInsertFront004", 0, function () {
let deque = new Deque();
let a = [1, 2, 3, 4];
deque.insertFront(a);
let res = deque.getFirst();
expect(res).assertEqual(a);
});
it("SR000GGR3K_testInsertEnd005", 0, function () {
let deque = new Deque();
deque.insertEnd(8);
let res = deque.getLast();
expect(res).assertEqual(8);
});
it("SR000GGR3K_testInsertEnd006", 0, function () {
let deque = new Deque();
let a = ["a", "b", "c"];
deque.insertEnd(a);
let res = deque.getLast();
expect(res).assertEqual(a);
});
it("SR000GGR3K_testInsertEnd007", 0, function () {
let deque = new Deque();
let a = {class: "6班", say: "we"};
deque.insertEnd(a);
let res = deque.getLast();
expect(res).assertEqual(a);
});
it("SR000GGR3K_testGetFirst007", 0, function () {
let deque = new Deque();
deque.insertEnd("");
deque.insertEnd("");
let res = deque.getFirst();
expect(res).assertEqual("");
});
it("SR000GGR3K_testGetLast008", 0, function () {
let deque = new Deque();
deque.insertEnd(8);
deque.insertEnd("");
let res = deque.getLast();
expect(res).assertEqual("");
});
it("SR000GGR3K_testHas009", 0, function () {
let deque = new Deque();
deque.insertEnd(6);
let res = deque.has(6);
expect(res).assertEqual(true);
});
it("SR000GGR3K_testHas010", 0, function () {
let deque = new Deque();
deque.insertEnd(8);
let res = deque.has(6);
expect(res).assertEqual(false);
});
it("SR000GGR3K_testPopFirst011", 0, function () {
let deque = new Deque();
deque.insertEnd(8);
deque.insertFront("");
let res = deque.popFirst();
expect(res).assertEqual("");
});
it("SR000GGR3K_testPopLast012", 0, function () {
let deque = new Deque();
deque.insertEnd(8);
deque.insertFront("");
deque.insertFront("");
let res = deque.popLast();
expect(res).assertEqual(8);
});
it("SR000GGR3K_testForEach013", 0, function () {
let deque = new Deque();
deque.insertEnd(8);
deque.insertFront("");
deque.insertFront("");
deque.insertEnd(1);
deque.insertEnd(2);
deque.insertEnd(3);
deque.insertEnd(4);
deque.insertEnd(5);
deque.insertEnd(6);
deque.insertFront("");
deque.insertFront("");
let arr = [];
deque.forEach((item, index) => {
arr.push(item);
});
let a = ["", "", "", "", 8, 1, 2, 3, 4, 5, 6];
for (let i = 0; i < a.length; i++) {
expect(arr[i]).assertEqual(a[i]);
}
});
it("SR000GGR3K_testIterator014", 0, function () {
let deque = new Deque();
deque.insertEnd(8);
deque.insertFront("");
deque.insertFront("");
deque.insertEnd(5);
deque.insertEnd(6);
deque.insertFront("");
deque.insertFront("");
let arr = [];
for (let item of deque) {
arr.push(item);
}
let a = ["", "", "", "", 8, 5, 6];
for (let i = 0; i < a.length; i++) {
expect(arr[i]).assertEqual(a[i]);
}
});
it("SR000GGR3K_testInsertFront015", 0, function () {
let deque = new Deque();
deque.insertFront("$");
let res = deque.getFirst();
expect(res).assertEqual("$");
});
it("SR000GGR3K_testInsertFront016", 0, function () {
let deque = new Deque();
deque.insertFront(" ");
let res = deque.getFirst();
expect(res).assertEqual(" ");
});
it("SR000GGR3K_testInsertFront017", 0, function () {
let deque = new Deque();
deque.insertFront(null);
let res = deque.getFirst();
expect(res).assertEqual(null);
});
it("SR000GGR3K_testInsertFront018", 0, function () {
let deque = new Deque();
deque.insertFront(undefined);
let res = deque.getFirst();
expect(res).assertEqual(undefined);
});
it("SR000GGR3K_testInsertFront019", 0, function () {
let deque = new Deque();
for (let i = 0; i < 100; i++) {
deque.insertFront(i);
let res = deque.getFirst();
expect(res).assertEqual(i);
}
let res1 = deque.length;
expect(res1).assertEqual(100);
});
it("SR000GGR3K_testInsertEnd020", 0, function () {
let deque = new Deque();
deque.insertEnd("$");
let res = deque.getLast();
expect(res).assertEqual("$");
});
it("SR000GGR3K_testInsertEnd021", 0, function () {
let deque = new Deque();
deque.insertEnd(" ");
let res = deque.getLast();
expect(res).assertEqual(" ");
});
it("SR000GGR3K_testInsertEnd022", 0, function () {
let deque = new Deque();
deque.insertEnd(null);
let res = deque.getLast();
expect(res).assertEqual(null);
});
it("SR000GGR3K_testInsertEnd023", 0, function () {
let deque = new Deque();
deque.insertEnd(undefined);
let res = deque.getLast();
expect(res).assertEqual(undefined);
});
it("SR000GGR3K_testInsertFront024", 0, function () {
let deque = new Deque();
for (let i = 0; i < 100; i++) {
deque.insertEnd(i);
let res = deque.getLast();
expect(res).assertEqual(i);
}
let res1 = deque.length;
expect(res1).assertEqual(100);
});
it("SR000GGR3K_testHas025", 0, function () {
let deque = new Deque();
let res = deque.has(6);
expect(res).assertEqual(false);
});
it("SR000GGR3K_testPopFirst026", 0, function () {
let deque = new Deque();
let res = deque.popFirst();
expect(res).assertEqual(undefined);
});
it("SR000GGR3K_testGetFirst027", 0, function () {
let deque = new Deque();
let res = deque.getFirst();
expect(res).assertEqual(undefined);
});
it("SR000GGR3K_testPopLast028", 0, function () {
let deque = new Deque();
try {
let res = deque.popLast();
} catch (err) {
expect(err).assertEqual("Error: Deque: get out-of-bounds");
}
});
it("SR000GGR3K_testGetLast029", 0, function () {
let deque = new Deque();
try {
let res = deque.getLast();
} catch (err) {
expect(err).assertEqual("Error: Deque: get out-of-bounds");
}
});
it("SR000GGR3K_testForEach030", 0, function () {
let deque = new Deque();
deque.insertEnd(8);
deque.insertEnd(1);
deque.insertEnd(2);
deque.insertEnd(3);
deque.insertEnd(3);
deque.insertEnd(4);
deque.insertEnd(5);
deque.insertEnd(6);
deque.popFirst();
deque.popLast();
deque.insertFront(8);
deque.insertEnd(6);
let arr = [];
deque.forEach((item, index) => {
arr.push(item);
});
let a = [8, 1, 2, 3, 3, 4, 5, 6];
for (let i = 0; i < a.length; i++) {
expect(arr[i]).assertEqual(a[i]);
}
});
it("SR000GGR3K_testIterator031", 0, function () {
let deque = new Deque();
deque.insertEnd(8);
deque.insertFront("");
deque.insertFront("");
deque.insertEnd(5);
deque.insertEnd(6);
deque.insertFront("");
deque.insertFront("");
deque.popFirst();
deque.popLast();
deque.insertFront("");
deque.insertEnd(6);
let arr = [];
for (let item of deque) {
arr.push(item);
}
let a = ["", "", "", "", 8, 5, 6];
for (let i = 0; i < a.length; i++) {
expect(arr[i]).assertEqual(a[i]);
}
});
it("SR000GGR3K_testIterator032", 0, function () {
let deque = new Deque();
deque.insertEnd(8);
deque.insertFront("a");
deque.insertFront("b");
deque.insertEnd(5);
deque.insertEnd(6);
deque.insertFront("s");
deque.insertFront("z");
deque.popFirst();
deque.popLast();
deque.insertFront("g");
deque.insertEnd(6);
let size = deque.length;
let arr = [];
let itr = deque[Symbol.iterator]();
for (let i = 0; i < size; i++) {
arr.push(itr.next().value);
}
let a = ["g", "s", "b", "a", 8, 5, 6];
for (let i = 0; i < a.length; i++) {
expect(arr[i]).assertEqual(a[i]);
}
});
});
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the 'License')
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index';
import Deque from "@ohos.util.Deque";
describe("DequeTest", function () {
it("SR000GGR3K_testConstructor001", 0, function () {
try {
let deque = new Deque();
} catch (err) {
expect(err).assertEqual("Error:Cannot create new deque");
}
});
it("SR000GGR3K_testInsertFront001", 0, function () {
let deque = new Deque();
deque.insertFront("");
let res = deque.getFirst();
expect(res).assertEqual("");
});
it("SR000GGR3K_testInsertFront002", 0, function () {
let deque = new Deque();
deque.insertFront(8);
let res = deque.getFirst();
expect(res).assertEqual(8);
});
it("SR000GGR3K_testInsertFront003", 0, function () {
let deque = new Deque();
let a = {name: "lala", age: "15"};
deque.insertFront(a);
let res = deque.getFirst();
expect(res).assertEqual(a);
});
it("SR000GGR3K_testInsertFront004", 0, function () {
let deque = new Deque();
let a = [1, 2, 3, 4];
deque.insertFront(a);
let res = deque.getFirst();
expect(res).assertEqual(a);
});
it("SR000GGR3K_testInsertEnd005", 0, function () {
let deque = new Deque();
deque.insertEnd(8);
let res = deque.getLast();
expect(res).assertEqual(8);
});
it("SR000GGR3K_testInsertEnd006", 0, function () {
let deque = new Deque();
let a = ["a", "b", "c"];
deque.insertEnd(a);
let res = deque.getLast();
expect(res).assertEqual(a);
});
it("SR000GGR3K_testInsertEnd007", 0, function () {
let deque = new Deque();
let a = {class: "6班", say: "we"};
deque.insertEnd(a);
let res = deque.getLast();
expect(res).assertEqual(a);
});
it("SR000GGR3K_testGetFirst007", 0, function () {
let deque = new Deque();
deque.insertEnd("");
deque.insertEnd("");
let res = deque.getFirst();
expect(res).assertEqual("");
});
it("SR000GGR3K_testGetLast008", 0, function () {
let deque = new Deque();
deque.insertEnd(8);
deque.insertEnd("");
let res = deque.getLast();
expect(res).assertEqual("");
});
it("SR000GGR3K_testHas009", 0, function () {
let deque = new Deque();
deque.insertEnd(6);
let res = deque.has(6);
expect(res).assertEqual(true);
});
it("SR000GGR3K_testHas010", 0, function () {
let deque = new Deque();
deque.insertEnd(8);
let res = deque.has(6);
expect(res).assertEqual(false);
});
it("SR000GGR3K_testPopFirst011", 0, function () {
let deque = new Deque();
deque.insertEnd(8);
deque.insertFront("");
let res = deque.popFirst();
expect(res).assertEqual("");
});
it("SR000GGR3K_testPopLast012", 0, function () {
let deque = new Deque();
deque.insertEnd(8);
deque.insertFront("");
deque.insertFront("");
let res = deque.popLast();
expect(res).assertEqual(8);
});
it("SR000GGR3K_testForEach013", 0, function () {
let deque = new Deque();
deque.insertEnd(8);
deque.insertFront("");
deque.insertFront("");
deque.insertEnd(1);
deque.insertEnd(2);
deque.insertEnd(3);
deque.insertEnd(4);
deque.insertEnd(5);
deque.insertEnd(6);
deque.insertFront("");
deque.insertFront("");
let arr = [];
deque.forEach((item, index) => {
arr.push(item);
});
let a = ["", "", "", "", 8, 1, 2, 3, 4, 5, 6];
for (let i = 0; i < a.length; i++) {
expect(arr[i]).assertEqual(a[i]);
}
});
it("SR000GGR3K_testIterator014", 0, function () {
let deque = new Deque();
deque.insertEnd(8);
deque.insertFront("");
deque.insertFront("");
deque.insertEnd(5);
deque.insertEnd(6);
deque.insertFront("");
deque.insertFront("");
let arr = [];
for (let item of deque) {
arr.push(item);
}
let a = ["", "", "", "", 8, 5, 6];
for (let i = 0; i < a.length; i++) {
expect(arr[i]).assertEqual(a[i]);
}
});
it("SR000GGR3K_testInsertFront015", 0, function () {
let deque = new Deque();
deque.insertFront("$");
let res = deque.getFirst();
expect(res).assertEqual("$");
});
it("SR000GGR3K_testInsertFront016", 0, function () {
let deque = new Deque();
deque.insertFront(" ");
let res = deque.getFirst();
expect(res).assertEqual(" ");
});
it("SR000GGR3K_testInsertFront017", 0, function () {
let deque = new Deque();
deque.insertFront(null);
let res = deque.getFirst();
expect(res).assertEqual(null);
});
it("SR000GGR3K_testInsertFront018", 0, function () {
let deque = new Deque();
deque.insertFront(undefined);
let res = deque.getFirst();
expect(res).assertEqual(undefined);
});
it("SR000GGR3K_testInsertFront019", 0, function () {
let deque = new Deque();
for (let i = 0; i < 100; i++) {
deque.insertFront(i);
let res = deque.getFirst();
expect(res).assertEqual(i);
}
let res1 = deque.length;
expect(res1).assertEqual(100);
});
it("SR000GGR3K_testInsertEnd020", 0, function () {
let deque = new Deque();
deque.insertEnd("$");
let res = deque.getLast();
expect(res).assertEqual("$");
});
it("SR000GGR3K_testInsertEnd021", 0, function () {
let deque = new Deque();
deque.insertEnd(" ");
let res = deque.getLast();
expect(res).assertEqual(" ");
});
it("SR000GGR3K_testInsertEnd022", 0, function () {
let deque = new Deque();
deque.insertEnd(null);
let res = deque.getLast();
expect(res).assertEqual(null);
});
it("SR000GGR3K_testInsertEnd023", 0, function () {
let deque = new Deque();
deque.insertEnd(undefined);
let res = deque.getLast();
expect(res).assertEqual(undefined);
});
it("SR000GGR3K_testInsertFront024", 0, function () {
let deque = new Deque();
for (let i = 0; i < 100; i++) {
deque.insertEnd(i);
let res = deque.getLast();
expect(res).assertEqual(i);
}
let res1 = deque.length;
expect(res1).assertEqual(100);
});
it("SR000GGR3K_testHas025", 0, function () {
let deque = new Deque();
let res = deque.has(6);
expect(res).assertEqual(false);
});
it("SR000GGR3K_testPopFirst026", 0, function () {
let deque = new Deque();
let res = deque.popFirst();
expect(res).assertEqual(undefined);
});
it("SR000GGR3K_testGetFirst027", 0, function () {
let deque = new Deque();
let res = deque.getFirst();
expect(res).assertEqual(undefined);
});
it("SR000GGR3K_testPopLast028", 0, function () {
let deque = new Deque();
try {
let res = deque.popLast();
} catch (err) {
expect(err).assertEqual("Error: Deque: get out-of-bounds");
}
});
it("SR000GGR3K_testGetLast029", 0, function () {
let deque = new Deque();
try {
let res = deque.getLast();
} catch (err) {
expect(err).assertEqual("Error: Deque: get out-of-bounds");
}
});
it("SR000GGR3K_testForEach030", 0, function () {
let deque = new Deque();
deque.insertEnd(8);
deque.insertEnd(1);
deque.insertEnd(2);
deque.insertEnd(3);
deque.insertEnd(3);
deque.insertEnd(4);
deque.insertEnd(5);
deque.insertEnd(6);
deque.popFirst();
deque.popLast();
deque.insertFront(8);
deque.insertEnd(6);
let arr = [];
deque.forEach((item, index) => {
arr.push(item);
});
let a = [8, 1, 2, 3, 3, 4, 5, 6];
for (let i = 0; i < a.length; i++) {
expect(arr[i]).assertEqual(a[i]);
}
});
it("SR000GGR3K_testIterator031", 0, function () {
let deque = new Deque();
deque.insertEnd(8);
deque.insertFront("");
deque.insertFront("");
deque.insertEnd(5);
deque.insertEnd(6);
deque.insertFront("");
deque.insertFront("");
deque.popFirst();
deque.popLast();
deque.insertFront("");
deque.insertEnd(6);
let arr = [];
for (let item of deque) {
arr.push(item);
}
let a = ["", "", "", "", 8, 5, 6];
for (let i = 0; i < a.length; i++) {
expect(arr[i]).assertEqual(a[i]);
}
});
it("SR000GGR3K_testIterator032", 0, function () {
let deque = new Deque();
deque.insertEnd(8);
deque.insertFront("a");
deque.insertFront("b");
deque.insertEnd(5);
deque.insertEnd(6);
deque.insertFront("s");
deque.insertFront("z");
deque.popFirst();
deque.popLast();
deque.insertFront("g");
deque.insertEnd(6);
let size = deque.length;
let arr = [];
let itr = deque[Symbol.iterator]();
for (let i = 0; i < size; i++) {
arr.push(itr.next().value);
}
let a = ["g", "s", "b", "a", 8, 5, 6];
for (let i = 0; i < a.length; i++) {
expect(arr[i]).assertEqual(a[i]);
}
});
});
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import app from '@system.app'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
describe('appInfoTest', function () {
it('app_info_test_001', 0, function () {
var info = app.getInfo()
expect(info.versionCode).assertEqual('1000000')
})
})
\ No newline at end of file
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require('./ExampleJsunit.test.js');
require('./Deque.test.js');
require('./ArrayList.test.js');
require('./Queue.test.js');
require('./Stack.test.js');
require('./List.test.js');
require('./LinkedList.test.js');
require('./Vector.test.js');
此差异已折叠。
此差异已折叠。
{
"strings": {
"hello": "Hello",
"world": "World"
}
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册