📄 testchartoken.java
字号:
package jmathlibtests.core.tokens;
import jmathlib.core.interpreter.Interpreter;
import jmathlib.core.tokens.numbertokens.DoubleNumberToken;
import jmathlib.tools.junit.framework.*;
import jmathlib.core.tokens.*;
public class testCharToken extends TestCase
{
private CharToken string1;
private CharToken string2;
private DoubleNumberToken number;
protected Interpreter ml;
public testCharToken(String name)
{
super(name);
}
public static void main(String[] args)
{
jmathlib.tools.junit.textui.TestRunner.run (suite());
}
public static Test suite()
{
return new TestSuite(testCharToken.class);
}
public void setUp()
{
string1 = new CharToken("A String");
string2 = new CharToken("Another String");
number = new DoubleNumberToken(1);
ml = new Interpreter(true);
}
public void testAdd1()
{
CharToken expectedResult = new CharToken("A StringAnother String");
Token actualResult = string1.add(string2);
assertEquals(expectedResult.toString(), actualResult.toString());
}
public void testAdd2()
{
CharToken expectedResult = new CharToken("A String1");
Token actualResult = string1.add(number);
assertEquals(expectedResult.toString(), actualResult.toString());
}
public void testCharToken003() {
ml.executeExpression("a='bar'+'foo'");
assertTrue(ml.getString("a").equals("barfoo"));
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -