1/* 2 * Copyright (c) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16export let test: string = "test"; 17 18function testReplacementWoAt() { 19 import("@normalized:N&module&bundle&lib/importfile1&1.0.0"); 20 import("@normalized:N&module&bundle&lib/importfile1&"); 21 import("@normalized:N&&bundle&lib/importfile1&1.0.0"); 22 import("@normalized:N&&bundle&lib/importfile1&"); 23 24 // No-effect since no version info in compileContextInfo.json 25 import("@normalized:N&&&lib2/importfile3&"); 26} 27 28function testReplacementWithAt() { 29 import("@normalized:N&module&&@ohos/lib/importfile2&1.0.0"); 30 import("@normalized:N&module&&@ohos/lib/importfile2&"); 31 import("@normalized:N&&&@ohos/lib/importfile2&1.0.0"); 32 import("@normalized:N&&&@ohos/lib/importfile2&"); 33 34 // No-effect since no version info in compileContextInfo.json 35 import("@normalized:N&&&@ohos/lib2/importfile4&"); 36} 37 38function testNonOhmurl() { 39 import("aaa"); 40} 41 42function testNonConst() { 43 // Take effect only under release due to bcopt 44 let a = "@normalized:N&&bundle&lib/importfile1&" 45 import(a); 46 47 a = "@normalized:N&&bundle&lib/importfile1&"; 48 let b = "@normalized:N&&bundle&lib/importfile1&"; 49 import(a); 50 51 a = "@normalized:N&&bundle&lib/importfile1&"; 52 "@normalized:N&&bundle&lib/importfile1&"; 53 import(a); 54}