From 4a049b9b01259510c8617bbf357eb766d6922959 Mon Sep 17 00:00:00 2001 From: Dmitry Gridin Date: Fri, 9 Aug 2019 14:42:53 +0300 Subject: [PATCH] GenerateTests: cleanup code --- .../kotlin/generators/tests/GenerateTests.kt | 108 +++++++++++++++--- 1 file changed, 89 insertions(+), 19 deletions(-) diff --git a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt index c66905ebb14..4e9f375091f 100644 --- a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt +++ b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt @@ -245,7 +245,7 @@ fun main(args: Array) { } testClass { - model("decompiler/navigation/usercode", testClassName ="UsercodeWithJSModule") + model("decompiler/navigation/usercode", testClassName = "UsercodeWithJSModule") } testClass { @@ -489,15 +489,21 @@ fun main(args: Array) { testClass { model("formatter", pattern = """^([^\.]+)\.after\.kt.*$""") - model("formatter", pattern = """^([^\.]+)\.after\.inv\.kt.*$""", - testMethod = "doTestInverted", testClassName = "FormatterInverted") + model( + "formatter", pattern = """^([^\.]+)\.after\.inv\.kt.*$""", + testMethod = "doTestInverted", testClassName = "FormatterInverted" + ) } testClass { - model("indentationOnNewline", pattern = """^([^\.]+)\.after\.kt.*$""", testMethod = "doNewlineTest", - testClassName = "DirectSettings") - model("indentationOnNewline", pattern = """^([^\.]+)\.after\.inv\.kt.*$""", testMethod = "doNewlineTestWithInvert", - testClassName = "InvertedSettings") + model( + "indentationOnNewline", pattern = """^([^\.]+)\.after\.kt.*$""", testMethod = "doNewlineTest", + testClassName = "DirectSettings" + ) + model( + "indentationOnNewline", pattern = """^([^\.]+)\.after\.inv\.kt.*$""", testMethod = "doNewlineTestWithInvert", + testClassName = "InvertedSettings" + ) } testClass { @@ -541,8 +547,20 @@ fun main(args: Array) { } testClass { - model("copyPaste/imports", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doTestCopy", testClassName = "Copy", recursive = false) - model("copyPaste/imports", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doTestCut", testClassName = "Cut", recursive = false) + model( + "copyPaste/imports", + pattern = KT_WITHOUT_DOTS_IN_NAME, + testMethod = "doTestCopy", + testClassName = "Copy", + recursive = false + ) + model( + "copyPaste/imports", + pattern = KT_WITHOUT_DOTS_IN_NAME, + testMethod = "doTestCut", + testClassName = "Cut", + recursive = false + ) } testClass { @@ -635,9 +653,24 @@ fun main(args: Array) { } testClass { - model("debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepIntoTest", testClassName = "StepInto") - model("debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doSmartStepIntoTest", testClassName = "SmartStepInto") - model("debugger/tinyApp/src/stepping/stepInto", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepIntoTest", testClassName = "StepIntoOnly") + model( + "debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto", + pattern = KT_WITHOUT_DOTS_IN_NAME, + testMethod = "doStepIntoTest", + testClassName = "StepInto" + ) + model( + "debugger/tinyApp/src/stepping/stepIntoAndSmartStepInto", + pattern = KT_WITHOUT_DOTS_IN_NAME, + testMethod = "doSmartStepIntoTest", + testClassName = "SmartStepInto" + ) + model( + "debugger/tinyApp/src/stepping/stepInto", + pattern = KT_WITHOUT_DOTS_IN_NAME, + testMethod = "doStepIntoTest", + testClassName = "StepIntoOnly" + ) model("debugger/tinyApp/src/stepping/stepOut", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOutTest") model("debugger/tinyApp/src/stepping/stepOver", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOverTest") model("debugger/tinyApp/src/stepping/stepOverForce", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOverForceTest") @@ -803,15 +836,45 @@ fun main(args: Array) { } testClass { - model("scratch", extension = "kts", testMethod = "doScratchCompilingTest", testClassName = "ScratchCompiling", recursive = false) + model( + "scratch", + extension = "kts", + testMethod = "doScratchCompilingTest", + testClassName = "ScratchCompiling", + recursive = false + ) model("scratch", extension = "kts", testMethod = "doScratchReplTest", testClassName = "ScratchRepl", recursive = false) - model("scratch/multiFile", extension = null, testMethod = "doScratchMultiFileTest", testClassName = "ScratchMultiFile", recursive = false) + model( + "scratch/multiFile", + extension = null, + testMethod = "doScratchMultiFileTest", + testClassName = "ScratchMultiFile", + recursive = false + ) - model("worksheet", extension = "ws.kts", testMethod = "doWorksheetCompilingTest", testClassName = "WorksheetCompiling", recursive = false) + model( + "worksheet", + extension = "ws.kts", + testMethod = "doWorksheetCompilingTest", + testClassName = "WorksheetCompiling", + recursive = false + ) model("worksheet", extension = "ws.kts", testMethod = "doWorksheetReplTest", testClassName = "WorksheetRepl", recursive = false) - model("worksheet/multiFile", extension = null, testMethod = "doWorksheetMultiFileTest", testClassName = "WorksheetMultiFile", recursive = false) + model( + "worksheet/multiFile", + extension = null, + testMethod = "doWorksheetMultiFileTest", + testClassName = "WorksheetMultiFile", + recursive = false + ) - model("scratch/rightPanelOutput", extension = "kts", testMethod = "doRightPreviewPanelOutputTest", testClassName = "ScratchRightPanelOutput", recursive = false) + model( + "scratch/rightPanelOutput", + extension = "kts", + testMethod = "doRightPreviewPanelOutputTest", + testClassName = "ScratchRightPanelOutput", + recursive = false + ) } testClass { @@ -870,7 +933,11 @@ fun main(args: Array) { } testClass { - model("asJava/lightClasses", excludeDirs = listOf("local", "compilationErrors", "ideRegression"), pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME) + model( + "asJava/lightClasses", + excludeDirs = listOf("local", "compilationErrors", "ideRegression"), + pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME + ) } } @@ -1103,7 +1170,10 @@ fun main(args: Array) { } } - testGroup("plugins/android-extensions/android-extensions-compiler/test", "plugins/android-extensions/android-extensions-compiler/testData") { + testGroup( + "plugins/android-extensions/android-extensions-compiler/test", + "plugins/android-extensions/android-extensions-compiler/testData" + ) { testClass { model("descriptors", recursive = false, extension = null) }