/**
 * 
 */
package test.blog;

import org.junit.Test;

import blog.Main;

/**
 * @author leili
 * @since Nov 23, 2012
 * 
 */
public class TestOperator {

	private static String[] args = { "-n", "1" };

	@Test
	public void testConstantPLus() {
		String code = "fixed Integer x = 1 + 2; \n " + "query x;";
		Main.runFromString(code, args);
	}

	@Test
	public void testConstantMult() {
		String code = "fixed Integer x = 1 * 2; \n " + "query x;";
		Main.runFromString(code, args);
	}

	@Test
	public void testConstantDiv() {
		String code = "fixed Real x = 1.0 / 2.0; \n " + "query x;";
		Main.runFromString(code, args);
	}

	@Test
	public void testConstantMinus() {
		String code = "fixed Real x = 1.0 - 2.0; \n " + "query x;";
		Main.runFromString(code, args);
	}

	@Test
	public void testVarPlus() {
		String code = "fixed Integer x = 1; fixed Integer y = 2; "
				+ "fixed Integer z = x + y; query z;";
		Main.runFromString(code, args);
	}

}

@@ -937,10 +937,306 @@
 s);%0A%09%7D%0A%0A
+%09@Test%0A%09public void testMultiInFunction() %7B%0A%09%09String code = %22random Integer qstate(Integer t) %7B%5Cn%22 + %22%5Cn%22%0A%09%09%09%09+ %22  if t != 0 then%5Cn%22 + %22%5Cn%22 + %22    = t*2%5Cn%22 + %22%5Cn%22 + %22  else%5Cn%22%0A%09%09%09%09+ %22%5Cn%22 + %22    = 0%5Cn%22 + %22%5Cn%22 + %22%7D;%22%0A%09%09%09%09+ %22query qstate(2); query qstate(0);%22;%0A%09%09Main.runFromString(code, args);%0A%09%7D%0A%0A
 %7D%0A

add a new test