Package tests

Source Code of tests.UnarOperation

package tests;
import static junit.framework.Assert.assertTrue;
import static utils.TestHelper.parseExpression;

import org.antlr.runtime.RecognitionException;
import org.junit.Test;

import tree.HaxeTree;
import tree.expression.Unary;

public class UnarOperation
{
    ///
    /// Parcer
    ///
    @Test
    public void testUnarOpNot() throws RecognitionException {
        HaxeTree tree = parseExpression("!x");
        assertTrue(tree instanceof Unary);
    }
   
    @Test
    public void testUnarOpSub() throws RecognitionException {
        HaxeTree tree = parseExpression("-x");
        assertTrue(tree instanceof Unary);
    }
   
    @Test
    public void testUnarOpIncrement() throws RecognitionException {
        HaxeTree tree = parseExpression("++x");
        assertTrue(tree instanceof Unary);
    }
   
    @Test
    public void testUnarOpIncrement2() throws RecognitionException {
        HaxeTree tree = parseExpression("x++");
        assertTrue(tree instanceof Unary);
    }
   
    @Test
    public void testUnarOpDecrement() throws RecognitionException {
        HaxeTree tree = parseExpression("--x");
        assertTrue(tree instanceof Unary);
    }
   
    @Test
    public void testUnarOpDecrement2() throws RecognitionException {
        HaxeTree tree = parseExpression("x--");
        assertTrue(tree instanceof Unary);
    }
   
    @Test
    public void testUnarOpComplement() throws RecognitionException {
        HaxeTree tree = parseExpression("~x");
        assertTrue(tree instanceof Unary);
    }
}
TOP

Related Classes of tests.UnarOperation

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.