Unit tests updated
This commit is contained in:
@@ -1,10 +1,19 @@
|
||||
package test.input;
|
||||
package unit.classes;
|
||||
|
||||
public class TestLoop {
|
||||
public class TestClassLoop {
|
||||
|
||||
public static void main(String[] args) {
|
||||
public static void testSimpleInfinite() {
|
||||
|
||||
boolean a = true;
|
||||
while(true) {
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void testFinally() {
|
||||
|
||||
boolean a = (Math.random() > 0);
|
||||
|
||||
while(true) {
|
||||
try {
|
||||
if(!a) {
|
||||
@@ -16,5 +25,24 @@ public class TestLoop {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void testFinallyContinue() {
|
||||
|
||||
boolean a = (Math.random() > 0);
|
||||
|
||||
for(;;) {
|
||||
try {
|
||||
System.out.println("1");
|
||||
} finally {
|
||||
if(a) {
|
||||
System.out.println("3");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
System.out.println("4");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
16
test/unit/classes/TestClassSwitch.java
Normal file
16
test/unit/classes/TestClassSwitch.java
Normal file
@@ -0,0 +1,16 @@
|
||||
package unit.classes;
|
||||
|
||||
public class TestClassSwitch {
|
||||
|
||||
public void testCaseOrder(int a) {
|
||||
|
||||
switch(a) {
|
||||
case 13:
|
||||
System.out.println(13);
|
||||
return;
|
||||
case 5:
|
||||
System.out.println(5);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
21
test/unit/classes/TestClassTypes.java
Normal file
21
test/unit/classes/TestClassTypes.java
Normal file
@@ -0,0 +1,21 @@
|
||||
package unit.classes;
|
||||
|
||||
public class TestClassTypes {
|
||||
|
||||
public void testBoolean() {
|
||||
|
||||
byte var7 = 0;
|
||||
long time = System.currentTimeMillis();
|
||||
|
||||
if(time % 2 > 0) {
|
||||
var7 = 1;
|
||||
} else if(time % 3 > 0) {
|
||||
var7 = 2;
|
||||
}
|
||||
|
||||
if(var7 == 1) {
|
||||
System.out.println();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user