suthtest.xml

来自「实验软装置(基于表达式的计算器ExprEval) 很不错的 有帮助于学习提高」· XML 代码 · 共 76 行

XML
76
字号
<?xml version="1.0"?>
<!-- Simple test cases for EvalExpr -->
<test-case-definitions>

<test-case>
	<id>C001</id>
	<description>A simple expression.</description>
	<input>2^3*(3)-1</input>
	<output>23</output>
</test-case>

<test-case>
	<id>C002</id>
	<description>Expression with arithmetic operations.</description>
	<input>((((((((((12+2))))))))))</input>
	<output>14</output>
</test-case>

<test-case>
	<id>C003</id>
	<description>Expression with arithmetic operations.</description>
	<input>65 / 5 - 1300000e-5</input>
	<output>0.0</output>
</test-case>

<test-case>
	<id>E001</id>
	<description>Left parenthesis expected.</description>
	<input>((2 + 3) ^ 3) - ((1 + 1)</input>
	<exception>MissingRightParenthesisException</exception>
</test-case>

<test-case>
	<id>E002</id>
	<description>Right parenthesis expected.</description>
	<input>2.25E+2 - (55.5 + 10/ (10 / 2-5) ^ 2)</input>
	<exception>DividedByZeroException</exception>
</test-case>

<test-case>
	<id>E003</id>
	<description>Operator expected.</description>
	<input>@ I love you, Compiler.</input>
	<exception>IllegalSymbolException</exception>
</test-case>

<test-case>
	<id>E004</id>
	<description>Operand expected.</description>
	<input>(1 *3 ^ (3 - ) + 5</input>
	<exception>MissingOperandException</exception>
</test-case>

<test-case>
	<id>E005</id>
	<description>Divided by 0.</description>
	<input>4 / (12 - 3 * 4) + 1</input>
	<exception>DividedByZeroException</exception>
</test-case>

<test-case>
	<id>E006</id>
	<description>Divided by 0.</description>
	<input>(true?3:2)+true</input>
	<exception>TypeMismatchedException</exception>
</test-case>

<test-case>
	<id>E007</id>
	<description>Divided by 0.</description>
	<input>!!true?,:3</input>
	<exception>TrinaryOperationException</exception>
</test-case>

</test-case-definitions>

⌨️ 快捷键说明

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