geforkt von Mirrors/FastAsyncWorldEdit
Fix not operator
(cherry picked from commit 00c7d3a157d8d859ede501d71282e82fba40e37b)
Dieser Commit ist enthalten in:
Ursprung
e20765beef
Commit
a464bde43b
@ -237,7 +237,7 @@ class ExpressionHandles {
|
||||
}
|
||||
|
||||
private static boolean doubleToBool(double bool) {
|
||||
return bool > 0;
|
||||
return bool != 0;
|
||||
}
|
||||
|
||||
static double boolToDouble(boolean bool) {
|
||||
|
@ -92,6 +92,15 @@ class ExpressionTest extends BaseExpressionTest {
|
||||
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
|
||||
public void testErrors() {
|
||||
// test lexer errors
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren