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 16package com.huawei.migrationtool.test.sts; 17 18class IfTest { 19 public Test(): void { 20 let t : boolean = true; 21 let a : int , b : int ; 22 if (t) a = 1; 23 if (t) a = 2; 24 else a = 3; 25 if (t) { 26 a = 4; 27 b = 100; 28 } 29 if (t) { 30 a = 5; 31 b = 101; 32 } 33 else { 34 a = 6; 35 b = 102; 36 } 37 if (t) a = 7; 38 else { 39 a = 8; 40 b = 103; 41 } 42 if (t) { 43 a = 9; 44 b = 104; 45 } 46 else a = 10; 47 let p : boolean = false; 48 if (t) if (p) a = 11; 49 else a = 12; 50 if (t) a = 13; 51 else if (p) { 52 a = 14; 53 } 54 if (t) a = 15; 55 else { 56 if (p) a = 16; 57 else a = 17; 58 } 59 if (t) { 60 if (p) { 61 a = 18; 62 b = 105; 63 } 64 else { 65 a = 19; 66 b = 106; 67 } 68 } 69 else if (p) a = 20; 70 else a = 21; 71 } 72} 73