File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -126,6 +126,7 @@ int getCompareExpr() throws Exception {
126126 ) {
127127 TokenIntf .Type tokenType = m_lexer .lookAhead ().m_type ;
128128 m_lexer .advance ();
129+
129130 switch (tokenType ){
130131 case GREATER :
131132 if (input > getShiftExpr ()){
Original file line number Diff line number Diff line change 1+ package com .compiler ;
2+
3+ import static org .junit .jupiter .api .Assertions .assertEquals ;
4+
5+ import org .junit .jupiter .api .Test ;
6+
7+ public class getCompareExprTest extends TestExpressionEvaluatorBase {
8+
9+ @ Test
10+ public void testCompareExprTest () throws Exception {
11+ // Check Java Compiler vs. unser Compiler
12+ assertEquals (1 , evalExpression ("4>1" ));
13+ assertEquals (0 , evalExpression ("4<1" ));
14+
15+ // Check Ergebnis vs. unser Compiler
16+ assertEquals (0 , evalExpression ("5==2" ));
17+ assertEquals (1 , evalExpression ("2==2" ));
18+
19+ // Komplexere Ausdrücke
20+ assertEquals (1 , evalExpression ("1>0=0" ));
21+ assertEquals (0 , evalExpression ("1<0=0" ));
22+ }
23+
24+ }
You can’t perform that action at this time.
0 commit comments