mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[kotlin] J2K tests: Remove redundant "//class" comments from testdata
"class" is the same as "file" now GitOrigin-RevId: 78ee93ca8551e68b1f59a2bd15506e67a5eeec49
This commit is contained in:
committed by
intellij-monorepo-bot
parent
cdd1afdd34
commit
3a64261060
+2
-5
@@ -16,7 +16,7 @@ import org.jetbrains.kotlin.psi.KtFile
|
||||
import java.io.File
|
||||
import java.util.regex.Pattern
|
||||
|
||||
private val testHeaderPattern: Pattern = Pattern.compile("//(expression|statement|method|class)\n")
|
||||
private val testHeaderPattern: Pattern = Pattern.compile("//(expression|statement|method)\n")
|
||||
|
||||
abstract class AbstractJavaToKotlinConverterSingleFileTest : AbstractJavaToKotlinConverterTest() {
|
||||
override fun setUp() {
|
||||
@@ -106,11 +106,8 @@ abstract class AbstractJavaToKotlinConverterSingleFileTest : AbstractJavaToKotli
|
||||
"expression" -> expressionToKotlin(javaCode, settings)
|
||||
"statement" -> statementToKotlin(javaCode, settings)
|
||||
"method" -> methodToKotlin(javaCode, settings)
|
||||
"class" -> fileToKotlin(javaCode, settings)
|
||||
"file" -> fileToKotlin(javaCode, settings)
|
||||
else -> throw IllegalStateException(
|
||||
"Specify what is it: file, class, method, statement or expression using the first line of test data file"
|
||||
)
|
||||
else -> error("Specify what it is: method, statement or expression using the first line of test data file")
|
||||
}
|
||||
|
||||
open fun fileToKotlin(text: String, settings: ConverterSettings): String {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
//class
|
||||
abstract class A {
|
||||
abstract void callme();
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// IGNORE_K2
|
||||
//class
|
||||
abstract class Shape {
|
||||
public String color;
|
||||
public Shape() {
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
//class
|
||||
class Test {}
|
||||
@@ -1,3 +1,2 @@
|
||||
// IGNORE_K2
|
||||
//class
|
||||
final class T {void main() {}int i() {}String s() {}}
|
||||
@@ -1,3 +1,2 @@
|
||||
// IGNORE_K2
|
||||
//class
|
||||
final class T {String a = "abc";int b = 10;}
|
||||
@@ -1,3 +1,2 @@
|
||||
// IGNORE_K2
|
||||
//class
|
||||
final class T {String a, b, c = "abc";}
|
||||
@@ -1,2 +1 @@
|
||||
//class
|
||||
final class A {}
|
||||
@@ -1,2 +1 @@
|
||||
//class
|
||||
final class Test {}
|
||||
@@ -1,2 +1 @@
|
||||
//class
|
||||
final class Entry<K, V> {}
|
||||
@@ -1,2 +1 @@
|
||||
//class
|
||||
final class A { final class B {} }
|
||||
@@ -1,2 +1 @@
|
||||
//class
|
||||
final class S { static class Inner {} }
|
||||
@@ -1,2 +1 @@
|
||||
//class
|
||||
class Test {}
|
||||
@@ -1,2 +1 @@
|
||||
//class
|
||||
final class S { boolean sB() { return true; } static int myI = 10; }
|
||||
@@ -1,2 +1 @@
|
||||
//class
|
||||
final class S { static boolean staticF() { return true; } }
|
||||
@@ -1,2 +1 @@
|
||||
//class
|
||||
final class S { boolean sB() { return true; } static int sI() { return 1; } }
|
||||
@@ -1,2 +1 @@
|
||||
//class
|
||||
private class Test {}
|
||||
@@ -1,2 +1 @@
|
||||
//class
|
||||
protected class Test {}
|
||||
@@ -1,2 +1 @@
|
||||
//class
|
||||
public class Test {}
|
||||
@@ -1,2 +1 @@
|
||||
//class
|
||||
final class S { static boolean sB() { return true; } static int sI() { return 1; } }
|
||||
@@ -1,5 +1,4 @@
|
||||
// IGNORE_K2
|
||||
//class
|
||||
package demo;
|
||||
|
||||
enum MyEnum {
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
//class
|
||||
enum A {}
|
||||
@@ -1,2 +1 @@
|
||||
//class
|
||||
enum A implements I {}
|
||||
-1
@@ -1,2 +1 @@
|
||||
//class
|
||||
enum A implements I0, I1, I2 {}
|
||||
@@ -1,3 +1,2 @@
|
||||
// IGNORE_K2
|
||||
//class
|
||||
enum E { I; private String name; }
|
||||
-1
@@ -1,5 +1,4 @@
|
||||
// IGNORE_K2
|
||||
//class
|
||||
enum Color {
|
||||
WHITE(21), BLACK(22), RED(23), YELLOW(24), BLUE(25);
|
||||
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
//class
|
||||
enum Test {}
|
||||
@@ -1,3 +1,2 @@
|
||||
// IGNORE_K2
|
||||
//class
|
||||
enum Color { WHITE, BLACK, RED, YELLOW, BLUE;@Override public String toString() { return "COLOR";}}
|
||||
@@ -1,5 +1,4 @@
|
||||
// IGNORE_K2
|
||||
//class
|
||||
package demo;
|
||||
|
||||
enum Color {
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
//class
|
||||
private enum Test {}
|
||||
@@ -1,2 +1 @@
|
||||
//class
|
||||
protected enum Test {}
|
||||
@@ -1,2 +1 @@
|
||||
//class
|
||||
public enum Test {}
|
||||
@@ -1,5 +1,4 @@
|
||||
// IGNORE_K2
|
||||
//class
|
||||
enum Color implements Runnable {
|
||||
WHITE, BLACK, RED, YELLOW, BLUE;
|
||||
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
//class
|
||||
enum Coin { PENNY, NICKEL, DIME, QUARTER; }
|
||||
@@ -1,2 +1 @@
|
||||
//class
|
||||
abstract interface I {}
|
||||
@@ -1,2 +1 @@
|
||||
//class
|
||||
interface A {}
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
//class
|
||||
interface I0 {}
|
||||
interface I1 {}
|
||||
interface I2 {}
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
// IGNORE_K2
|
||||
//class
|
||||
interface INode {String IN = "in";String AT = "@";String COMMA_WITH_SPACE = IN + AT;}
|
||||
-1
@@ -1,3 +1,2 @@
|
||||
// IGNORE_K2
|
||||
//class
|
||||
interface INode {Tag getTag();String toKotlin();}
|
||||
-1
@@ -1,3 +1,2 @@
|
||||
// IGNORE_K2
|
||||
//class
|
||||
public interface INode { public static final String IN = "in"; public static final String AT = "@"; public static final String COMMA_WITH_SPACE = IN + AT;}
|
||||
@@ -1,2 +1 @@
|
||||
//class
|
||||
interface Test {}
|
||||
@@ -1,2 +1 @@
|
||||
//class
|
||||
private interface Test {}
|
||||
@@ -1,2 +1 @@
|
||||
//class
|
||||
protected interface Test {}
|
||||
@@ -1,2 +1 @@
|
||||
//class
|
||||
public interface Test {}
|
||||
@@ -1,5 +1,4 @@
|
||||
// IGNORE_K2
|
||||
//class
|
||||
class Foo {
|
||||
Foo(int a, int b) {
|
||||
}
|
||||
|
||||
-1
@@ -1,5 +1,4 @@
|
||||
// IGNORE_K2
|
||||
//class
|
||||
class Foo {
|
||||
Foo(int a, int b) {
|
||||
}
|
||||
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
//class
|
||||
class Foo {}
|
||||
class Bar {
|
||||
void bar() {
|
||||
|
||||
-1
@@ -1,2 +1 @@
|
||||
//class
|
||||
interface CommandHandler<T extends Command> {}
|
||||
-1
@@ -1,2 +1 @@
|
||||
//class
|
||||
interface CommandHandler<T extends INode, String> {}
|
||||
@@ -1,2 +1 @@
|
||||
//class
|
||||
final class Comparable<T> {}
|
||||
Reference in New Issue
Block a user