New J2K: Split old j2k and new j2k tests
This commit is contained in:
committed by
Ilya Kirillov
parent
02a206bf7c
commit
b411e8e18e
@@ -1,82 +0,0 @@
|
||||
object SwitchDemo {
|
||||
fun test(i: Int): Int {
|
||||
var monthString = "<empty>"
|
||||
when (i) {
|
||||
1 -> {
|
||||
print(1)
|
||||
print(2)
|
||||
print(3)
|
||||
print(4)
|
||||
print(5)
|
||||
}
|
||||
2 -> {
|
||||
print(2)
|
||||
print(3)
|
||||
print(4)
|
||||
print(5)
|
||||
}
|
||||
3 -> {
|
||||
print(3)
|
||||
print(4)
|
||||
print(5)
|
||||
}
|
||||
4 -> {
|
||||
print(4)
|
||||
print(5)
|
||||
}
|
||||
5 -> print(5)
|
||||
6 -> {
|
||||
print(6)
|
||||
print(7)
|
||||
print(8)
|
||||
print(9)
|
||||
print(10)
|
||||
print(11)
|
||||
monthString = "December"
|
||||
}
|
||||
7 -> {
|
||||
print(7)
|
||||
print(8)
|
||||
print(9)
|
||||
print(10)
|
||||
print(11)
|
||||
monthString = "December"
|
||||
}
|
||||
8 -> {
|
||||
print(8)
|
||||
print(9)
|
||||
print(10)
|
||||
print(11)
|
||||
monthString = "December"
|
||||
}
|
||||
9 -> {
|
||||
print(9)
|
||||
print(10)
|
||||
print(11)
|
||||
monthString = "December"
|
||||
}
|
||||
10 -> {
|
||||
print(10)
|
||||
print(11)
|
||||
monthString = "December"
|
||||
}
|
||||
11 -> {
|
||||
print(11)
|
||||
monthString = "December"
|
||||
}
|
||||
12 -> monthString = "December"
|
||||
else -> {
|
||||
print(4)
|
||||
print(5)
|
||||
}
|
||||
}
|
||||
val status = ""
|
||||
return when (status) {
|
||||
"init", "dial", "transmit" -> 0x111111
|
||||
"ok" -> -0xff9a00
|
||||
"cancel" -> -0x99999a
|
||||
"fail", "busy", "error" -> -0x9a0000
|
||||
else -> -0x9a0000
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
package demo
|
||||
|
||||
object SwitchDemo {
|
||||
fun print(o: Any) {
|
||||
println(o)
|
||||
}
|
||||
|
||||
fun test(i: Int) {
|
||||
var monthString = "<empty>"
|
||||
when (i) {
|
||||
1 -> {
|
||||
print(1)
|
||||
print(2)
|
||||
print(3)
|
||||
print(4)
|
||||
print(5)
|
||||
}
|
||||
2 -> {
|
||||
print(2)
|
||||
print(3)
|
||||
print(4)
|
||||
print(5)
|
||||
}
|
||||
3 -> {
|
||||
print(3)
|
||||
print(4)
|
||||
print(5)
|
||||
}
|
||||
4 -> {
|
||||
print(4)
|
||||
print(5)
|
||||
}
|
||||
5 -> print(5)
|
||||
6 -> {
|
||||
print(6)
|
||||
print(7)
|
||||
print(8)
|
||||
print(9)
|
||||
print(10)
|
||||
print(11)
|
||||
monthString = "December"
|
||||
}
|
||||
7 -> {
|
||||
print(7)
|
||||
print(8)
|
||||
print(9)
|
||||
print(10)
|
||||
print(11)
|
||||
monthString = "December"
|
||||
}
|
||||
8 -> {
|
||||
print(8)
|
||||
print(9)
|
||||
print(10)
|
||||
print(11)
|
||||
monthString = "December"
|
||||
}
|
||||
9 -> {
|
||||
print(9)
|
||||
print(10)
|
||||
print(11)
|
||||
monthString = "December"
|
||||
}
|
||||
10 -> {
|
||||
print(10)
|
||||
print(11)
|
||||
monthString = "December"
|
||||
}
|
||||
11 -> {
|
||||
print(11)
|
||||
monthString = "December"
|
||||
}
|
||||
12 -> monthString = "December"
|
||||
else -> monthString = "Invalid month"
|
||||
}
|
||||
println(monthString)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun main(args: Array<String>) {
|
||||
for (i in 1..12)
|
||||
test(i)
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
internal enum class ColorEnum {
|
||||
GREEN
|
||||
}
|
||||
|
||||
internal class MyClass {
|
||||
fun method(colorEnum: ColorEnum?): Int {
|
||||
return when (colorEnum) {
|
||||
ColorEnum.GREEN -> 1
|
||||
else -> 2
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package switch_demo
|
||||
|
||||
object SwitchDemo {
|
||||
@JvmStatic
|
||||
fun main(args: Array<String>) {
|
||||
val month = 8
|
||||
val monthString: String
|
||||
monthString = when (month) {
|
||||
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 -> "December"
|
||||
else -> "Invalid month"
|
||||
}
|
||||
println(monthString)
|
||||
}
|
||||
}
|
||||
+12
-12
@@ -1,16 +1,16 @@
|
||||
//file
|
||||
public class C {
|
||||
public static void main(String[] args) {
|
||||
switch (args.length) {
|
||||
case 1: {
|
||||
int a = 1;
|
||||
System.out.print("1");
|
||||
}
|
||||
public class C {
|
||||
public static void main(String[] args) {
|
||||
switch (args.length) {
|
||||
case 1: {
|
||||
int a = 1;
|
||||
System.out.print("1");
|
||||
}
|
||||
|
||||
case 2: {
|
||||
int a = 2;
|
||||
System.out.print("2");
|
||||
}
|
||||
case 2: {
|
||||
int a = 2;
|
||||
System.out.print("2");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
-26
@@ -1,26 +0,0 @@
|
||||
package switch_demo
|
||||
|
||||
object SwitchDemo {
|
||||
@JvmStatic
|
||||
fun main(args: Array<String>) {
|
||||
|
||||
val month = 8
|
||||
val monthString: String
|
||||
monthString = when (month) {
|
||||
1 -> "January"
|
||||
2 -> "February"
|
||||
3 -> "March"
|
||||
4 -> "April"
|
||||
5 -> "May"
|
||||
6 -> "June"
|
||||
7 -> "July"
|
||||
8 -> "August"
|
||||
9 -> "September"
|
||||
10 -> "October"
|
||||
11 -> "November"
|
||||
12 -> "December"
|
||||
else -> "Invalid month"
|
||||
}
|
||||
println(monthString)
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fun foo(i: Int, j: Int): String {
|
||||
return when (i) {
|
||||
0 -> if (j > 0) {
|
||||
"1"
|
||||
} else {
|
||||
"2"
|
||||
}
|
||||
1 -> "3"
|
||||
else -> "4"
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fun foo(i: Int, j: Int): String {
|
||||
return when (i) {
|
||||
0 -> {
|
||||
if (j > 0) {
|
||||
"1"
|
||||
} else "2"
|
||||
}
|
||||
1 -> "2"
|
||||
else -> "3"
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fun foo(i: Int, j: Int): String {
|
||||
return when (i) {
|
||||
0 -> when (j) {
|
||||
1 -> "0, 1"
|
||||
else -> "0, x"
|
||||
}
|
||||
|
||||
1 -> "1, x"
|
||||
else -> "x, x"
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
fun foo(a: Int): Int {
|
||||
return when (a) {
|
||||
1 -> {
|
||||
println("1")
|
||||
1
|
||||
}
|
||||
2 -> {
|
||||
println("2")
|
||||
2
|
||||
}
|
||||
3 -> {
|
||||
println("3")
|
||||
throw RuntimeException()
|
||||
}
|
||||
else -> {
|
||||
println("default")
|
||||
0
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user