Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-12-26 02:50:06 +01:00
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) {
|
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
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren