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 16import {DependencyClass, DependencyFunctionReduce, DependencyInterface} from './depency-file1' 17import {NoDependencyClass, NoDependencyFunction, NoDependencyInterface} from './no-depency-file1' 18import assert from 'assert'; 19 20let tempIns = new DependencyClass(); 21let value1 = tempIns.depencyProp1; 22let value2= tempIns.depencyProp2; 23let methodAns = tempIns.depencyMethod1(); 24let tempAns = DependencyFunctionReduce(2,1); 25assert(tempAns === 1, 'success'); 26type tempType = DependencyInterface; 27let tempValue1: tempType = {depencyProp3: "hello", depencyProp4: 2}; 28const value3 = tempValue1.depencyProp3; 29const value4 = tempValue1.depencyProp4; 30 31let tempInsNoDepen = new NoDependencyClass(); 32let value1NoDepen = tempInsNoDepen.noDepencyProp1; 33let value2NoDepen= tempInsNoDepen.noDepencyProp2; 34let methodAnsNoDepen = tempInsNoDepen.noDepencyMethod1(); 35let tempAnsNoDepen = NoDependencyFunction(); 36type tempTypeNoDepen = NoDependencyInterface; 37let tempValue1NoDepen: tempTypeNoDepen = {noDepencyProp3: "hello", noDepencyProp4: 2}; 38const value3NoDepen = tempValue1NoDepen.noDepencyProp3; 39const value4NoDepen = tempValue1NoDepen.noDepencyProp4; 40 41export class TempCountry1 { 42 tempPropety1: string = 'us1'; 43 createTime1: number = 1999; 44} 45 46class TempCountry2 { 47 tempPropety2: string = 'us2'; 48 createTime2: number = 2000; 49} 50 51export function TempFoo1(para1: string, para2: string): string { 52 return para1.concat(para2); 53} 54const ans1 = TempFoo1('123','456'); 55assert(ans1 === '123456', 'success'); 56function TempFoo2(para3: string, para4: string): string { 57 return para3 + para4; 58} 59TempFoo2('123','456'); 60const ans2 = TempFoo2('123','456'); 61assert(ans2 === '123456', 'success');