mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 16:14:10 -08:00
Fix failed tests
This commit is contained in:
parent
0340bb9c73
commit
ce83560279
|
@ -198,8 +198,8 @@ public class AstWriterTest {
|
||||||
@Test
|
@Test
|
||||||
public void writesConditionalExpr() throws IOException {
|
public void writesConditionalExpr() throws IOException {
|
||||||
assertThat(transform("return cond ? 1 : 0;"), is("return cond?1:0;"));
|
assertThat(transform("return cond ? 1 : 0;"), is("return cond?1:0;"));
|
||||||
assertThat(transform("return a < b ? -1 : a > b ? 1 : 0;"), is("return a<b?-1:a>b?1:0;"));
|
assertThat(transform("return a < b ? -1 : a > b ? 1 : 0;"), is("return a<b? -1:a>b?1:0;"));
|
||||||
assertThat(transform("return a < b ? -1 : (a > b ? 1 : 0);"), is("return a<b?-1:a>b?1:0;"));
|
assertThat(transform("return a < b ? -1 : (a > b ? 1 : 0);"), is("return a<b? -1:a>b?1:0;"));
|
||||||
assertThat(transform("return (a < b ? x == y : x != y) ? 1 : 0;"), is("return (a<b?x==y:x!=y)?1:0;"));
|
assertThat(transform("return (a < b ? x == y : x != y) ? 1 : 0;"), is("return (a<b?x==y:x!=y)?1:0;"));
|
||||||
assertThat(transform("return a < b ? (x > y ? x : y) : z"), is("return a<b?(x>y?x:y):z;"));
|
assertThat(transform("return a < b ? (x > y ? x : y) : z"), is("return a<b?(x>y?x:y):z;"));
|
||||||
}
|
}
|
||||||
|
@ -233,11 +233,11 @@ public class AstWriterTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void writesUnary() throws IOException {
|
public void writesUnary() throws IOException {
|
||||||
assertThat(transform("return -a;"), is("return -a;"));
|
assertThat(transform("return -a;"), is("return -a;"));
|
||||||
assertThat(transform("return -(a + b);"), is("return -(a+b);"));
|
assertThat(transform("return -(a + b);"), is("return -(a+b);"));
|
||||||
assertThat(transform("return -a + b;"), is("return -a+b;"));
|
assertThat(transform("return -a + b;"), is("return -a+b;"));
|
||||||
assertThat(transform("return (-a) + b;"), is("return -a+b;"));
|
assertThat(transform("return (-a) + b;"), is("return -a+b;"));
|
||||||
assertThat(transform("return (-f)(x);"), is("return (-f)(x);"));
|
assertThat(transform("return (-f)(x);"), is("return ( -f)(x);"));
|
||||||
assertThat(transform("return typeof a;"), is("return typeof a;"));
|
assertThat(transform("return typeof a;"), is("return typeof a;"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -251,9 +251,9 @@ public class AstWriterTest {
|
||||||
assertThat(transform("return a + b + c;"), is("return a+b+c;"));
|
assertThat(transform("return a + b + c;"), is("return a+b+c;"));
|
||||||
assertThat(transform("return (a + b) + c;"), is("return a+b+c;"));
|
assertThat(transform("return (a + b) + c;"), is("return a+b+c;"));
|
||||||
assertThat(transform("return a + (b + c);"), is("return a+b+c;"));
|
assertThat(transform("return a + (b + c);"), is("return a+b+c;"));
|
||||||
assertThat(transform("return a - b + c;"), is("return a-b+c;"));
|
assertThat(transform("return a - b + c;"), is("return a -b+c;"));
|
||||||
assertThat(transform("return (a - b) + c;"), is("return a-b+c;"));
|
assertThat(transform("return (a - b) + c;"), is("return a -b+c;"));
|
||||||
assertThat(transform("return a - (b + c);"), is("return a-(b+c);"));
|
assertThat(transform("return a - (b + c);"), is("return a -(b+c);"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue
Block a user