switchStat.js revision 877:cf4d2252d444
150472Speter/* 27130Srgrimes * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. 378822Snik * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 450203Srgrimes * 57130Srgrimes * This code is free software; you can redistribute it and/or modify it 639161Sobrien * under the terms of the GNU General Public License version 2 only, as 78571Srgrimes * published by the Free Software Foundation. 8130416Smlaier * 9130416Smlaier * This code is distributed in the hope that it will be useful, but WITHOUT 108571Srgrimes * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 117130Srgrimes * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12122402Sharti * version 2 for more details (a copy is included in the LICENSE file that 13122402Sharti * accompanied this code). 14123051Sru * 15132751Skan * You should have received a copy of the GNU General Public License version 16123051Sru * 2 along with this work; if not, write to the Free Software Foundation, 17123051Sru * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18123051Sru * 19123051Sru * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20132751Skan * or visit www.oracle.com if you need additional information or have any 21132751Skan * questions. 22123051Sru */ 23123051Sru 24123051Sru/** 25123051Sru * Tests for switch statement. 2639250Sgibbs * 2739250Sgibbs * @test 2839250Sgibbs * @run 2939250Sgibbs */ 30104489Ssam 31104489Ssamload(__DIR__ + "util.js"); 3256583Sn_hibma 3388748SambriskoprintParse("switch (key) {}"); 3488748SambriskoprintParse("switch (key) { case 2: hello(); break; }"); 35123288SobrienprintParse("switch (key) { case 4: hello(); break; case 2: world(); break; default: break }"); 36123288Sobrien