jepprinttest.java

来自「这个是一个计算表达式的java包」· Java 代码 · 共 45 行

JAVA
45
字号
package com.singularsys.jeptests;import org.junit.Assert;import org.junit.Before;import org.junit.Test;import com.singularsys.jep.*;import com.singularsys.jep.bigdecimal.BigDecComponents;/** * Tests the print routines of the Jep class * @author singularsys */public class JEPPrintTest {		public JEPPrintTest() {	}		@Before	public void setUp() throws Exception {	}	@Test	public void checkOutput() throws Exception {		checkSingleParser(new Jep());	}		@Test	public void checkBigDec() throws Exception {		checkSingleParser(new Jep(new BigDecComponents()));			}	private void checkSingleParser(Jep jep) throws Exception {		// this string requires all the brackets since the inner operators are		// lower precedence than the outer ones		String in_exp = "1.0^(1.0%(1.0/(1.0*(1.0+(1.0<=(1.0<(1.0==(1.0&&(1.0||1.0)))))))))";		jep.parse(in_exp);		String out_exp = jep.rootNodeToString();		System.out.println(out_exp);		Assert.assertEquals(out_exp, in_exp);	}}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?