package dk.aau.sw402F15.tests.scanner;

import dk.aau.sw402F15.parser.lexer.LexerException;
import dk.aau.sw402F15.parser.parser.ParserException;
import dk.aau.sw402F15.tests.ScannerTest;
import org.junit.Test;

import java.io.IOException;

/**
 * Created by jnie on 15/04/15.
 */
public class SwitchStatement extends ScannerTest {
    @Test
    public void switchStatement() throws ParserException, IOException, LexerException {
        checkCode("void run() { switch ( expr ) { case expr : { break; } default : { break; } } }");
    }

    @Test(expected = ParserException.class)
    public void switchWithError() throws ParserException, IOException, LexerException {
        checkCode("void run() { switch ( expr ) { case : } }");
    }

}

@@ -734,10 +734,232 @@
 %0A    %7D%0A%0A
+    @Test%0A    public void switchWithMultipleCases() throws ParserException, IOException, LexerException %7B%0A        checkCode(%22void run() %7B switch ( expr ) %7B case expr: break; case expr: break; default: break; %7D %7D%22);%0A    %7D%0A%0A
 %7D%0A

Switch test