Add modulo, fix #319
Some checks failed
Build and Test with Maven / Build-and-test-with-Maven (push) Failing after 2m53s
Some checks failed
Build and Test with Maven / Build-and-test-with-Maven (push) Failing after 2m53s
This commit is contained in:
parent
e0d71a6003
commit
7fb4824f8d
@ -25,4 +25,10 @@ public class Op1 {
|
||||
var b = 20;
|
||||
return a ^ b;
|
||||
}
|
||||
|
||||
public mod() {
|
||||
var a = 10;
|
||||
var b = 2;
|
||||
return a % b;
|
||||
}
|
||||
}
|
@ -958,6 +958,8 @@ public class StatementGenerator {
|
||||
return BinaryExpr.Operator.EQUAL;
|
||||
} else if (operator.equals("!=")) {
|
||||
return BinaryExpr.Operator.NOTEQUAL;
|
||||
} else if (operator.equals("%")) {
|
||||
return BinaryExpr.Operator.MOD;
|
||||
} else {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
@ -848,6 +848,7 @@ public class TestComplete {
|
||||
assertEquals(clazz.getDeclaredMethod("or").invoke(instance), 10 | 20);
|
||||
assertEquals(clazz.getDeclaredMethod("and").invoke(instance), 10 & 20);
|
||||
assertEquals(clazz.getDeclaredMethod("xor").invoke(instance), 10 ^ 20);
|
||||
assertEquals(clazz.getDeclaredMethod("mod").invoke(instance), 10 % 2);
|
||||
}
|
||||
|
||||
@Ignore("Not implemented")
|
||||
|
Loading…
Reference in New Issue
Block a user