test long addition and subtraction in Misc, as well as multidimensional array creation

This commit is contained in:
Joel Dice 2008-05-18 09:45:52 -06:00
parent b2e25f4e17
commit c9f06933e2

View File

@ -101,6 +101,8 @@ public class Misc {
expect(a >> b == -5 >> 2);
expect(a >>> b == -5 >>> 2);
expect(a << b == -5 << 2);
expect(a + b == -5 + 2);
expect(a - b == -5 - 2);
expect(a * b == -5 * 2);
expect(a / b == -5 / 2);
expect(a % b == -5 % 2);
@ -115,6 +117,8 @@ public class Misc {
expect(a >> b == 5 >> 2);
expect(a >>> b == 5 >>> 2);
expect(a << b == 5 << 2);
expect(a + b == 5 + 2);
expect(a - b == 5 - 2);
expect(a * b == 5 * 2);
expect(a / b == 5 / 2);
expect(a % b == 5 % 2);
@ -130,6 +134,8 @@ public class Misc {
expect(a >> b == -5L >> 2);
expect(a >>> b == -5L >>> 2);
expect(a << b == -5L << 2);
expect(a + b == -5L + 2L);
expect(a - b == -5L - 2L);
expect(a * b == -5L * 2L);
expect(a / b == -5L / 2L);
expect(a % b == -5L % 2L);
@ -144,6 +150,8 @@ public class Misc {
expect(a >> b == 5L >> 2);
expect(a >>> b == 5L >>> 2);
expect(a << b == 5L << 2);
expect(a + b == 5L + 2L);
expect(a - b == 5L - 2L);
expect(a * b == 5L * 2L);
expect(a / b == 5L / 2L);
expect(a % b == 5L % 2L);
@ -235,7 +243,7 @@ public class Misc {
expect(zip() == 47);
expect(zup() == 47);
int[] array = new int[0];
{ int[] array = new int[0];
Exception exception = null;
try {
int x = array[0];
@ -245,4 +253,10 @@ public class Misc {
expect(exception != null);
}
{ Object[][] array = new Object[1][1];
expect(array.length == 1);
expect(array[0].length == 1);
}
}
}