mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
Fix not operator
(cherry picked from commit 00c7d3a157d8d859ede501d71282e82fba40e37b)
This commit is contained in:
parent
e20765beef
commit
a464bde43b
@ -237,7 +237,7 @@ class ExpressionHandles {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static boolean doubleToBool(double bool) {
|
private static boolean doubleToBool(double bool) {
|
||||||
return bool > 0;
|
return bool != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static double boolToDouble(boolean bool) {
|
static double boolToDouble(boolean bool) {
|
||||||
|
@ -92,6 +92,15 @@ class ExpressionTest extends BaseExpressionTest {
|
|||||||
checkTestCase("a=0; b=--a; a+b", -2);
|
checkTestCase("a=0; b=--a; a+b", -2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void testNot() {
|
||||||
|
checkTestCase("!0", 1);
|
||||||
|
checkTestCase("!1", 0);
|
||||||
|
checkTestCase("!2", 0);
|
||||||
|
checkTestCase("!-1", 0);
|
||||||
|
checkTestCase("!-2", 0);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testErrors() {
|
public void testErrors() {
|
||||||
// test lexer errors
|
// test lexer errors
|
||||||
|
Loading…
Reference in New Issue
Block a user