diff --git a/src/test/kotlin/com/compiler/server/KoansJUnitTestsRunnerTest.kt b/src/test/kotlin/com/compiler/server/KoansJUnitTestsRunnerTest.kt index b01ce16e..06c7b8ab 100644 --- a/src/test/kotlin/com/compiler/server/KoansJUnitTestsRunnerTest.kt +++ b/src/test/kotlin/com/compiler/server/KoansJUnitTestsRunnerTest.kt @@ -24,7 +24,7 @@ class KoansJUnitTestsRunnerTest : BaseJUnitTest() { @Test fun `koans test Default arguments`() { runKoanTest( - "fun foo(name: String, number: Int = 42, toUpperCase: Boolean = false) =\n (if (toUpperCase) name.toUpperCase() else name) + number\n\nfun useFoo() = listOf(\n foo(\"a\"),\n foo(\"b\", number = 1),\n foo(\"c\", toUpperCase = true),\n foo(name = \"d\", number = 2, toUpperCase = true)\n)", + "fun foo(name: String, number: Int = 42, toUpperCase: Boolean = false) =\n (if (toUpperCase) name.uppercase() else name) + number\n\nfun useFoo() = listOf(\n foo(\"a\"),\n foo(\"b\", number = 1),\n foo(\"c\", toUpperCase = true),\n foo(name = \"d\", number = 2, toUpperCase = true)\n)", "import org.junit.Test\nimport org.junit.Assert\n\nclass TestDefaultAndNamedParams() {\n\n @Test fun testDefaultAndNamedParams() {\n Assert.assertEquals(listOf(\"a42\", \"b1\", \"C42\", \"D2\"), useFoo())\n }\n}" ) } diff --git a/src/test/resources/test-compile-output/jvm/kotlin-by-example/02_Set/8ec43b0c11c651c669571c359f1e9556.1.json b/src/test/resources/test-compile-output/jvm/kotlin-by-example/02_Set/8ec43b0c11c651c669571c359f1e9556.1.json index d204d581..d782e9d1 100644 --- a/src/test/resources/test-compile-output/jvm/kotlin-by-example/02_Set/8ec43b0c11c651c669571c359f1e9556.1.json +++ b/src/test/resources/test-compile-output/jvm/kotlin-by-example/02_Set/8ec43b0c11c651c669571c359f1e9556.1.json @@ -1 +1 @@ -{"errors":{"File.kt":[{"interval":{"start":{"line":11,"ch":19},"end":{"line":11,"ch":25}},"message":"Redundant explicit type.","severity":"WARNING","className":"WARNING"},{"interval":{"start":{"line":12,"ch":26},"end":{"line":12,"ch":32}},"message":"Redundant explicit type.","severity":"WARNING","className":"WARNING"}]},"exception":null,"jvmByteCode":null,"text":"Issue uniqueDescr4 registered correctly.\nIssue uniqueDescr2 marked as duplicate and rejected.\n"} \ No newline at end of file +{"errors":{"File.kt":[]},"exception":null,"jvmByteCode":null,"text":"Issue uniqueDescr4 registered correctly.\nIssue uniqueDescr2 marked as duplicate and rejected.\n"} \ No newline at end of file diff --git a/src/test/resources/test-compile-output/jvm/kotlin-by-example/03_Variables/ff9d772244aab97db76d055793905ec6.1.json b/src/test/resources/test-compile-output/jvm/kotlin-by-example/03_Variables/ff9d772244aab97db76d055793905ec6.1.json index 563f0b79..8d2b7166 100644 --- a/src/test/resources/test-compile-output/jvm/kotlin-by-example/03_Variables/ff9d772244aab97db76d055793905ec6.1.json +++ b/src/test/resources/test-compile-output/jvm/kotlin-by-example/03_Variables/ff9d772244aab97db76d055793905ec6.1.json @@ -1 +1 @@ -{"errors":{"File.kt":[{"interval":{"start":{"line":2,"ch":4},"end":{"line":2,"ch":7}},"message":"The 'var' property is never written to, so it can be declared as 'val'.","severity":"WARNING","className":"WARNING"},{"interval":{"start":{"line":2,"ch":11},"end":{"line":2,"ch":17}},"message":"Redundant explicit type.","severity":"WARNING","className":"WARNING"},{"interval":{"start":{"line":4,"ch":8},"end":{"line":4,"ch":9}},"message":"Variable is unused.","severity":"WARNING","className":"WARNING"},{"interval":{"start":{"line":4,"ch":11},"end":{"line":4,"ch":14}},"message":"Redundant explicit type.","severity":"WARNING","className":"WARNING"},{"interval":{"start":{"line":5,"ch":8},"end":{"line":5,"ch":9}},"message":"Variable is unused.","severity":"WARNING","className":"WARNING"}]},"exception":null,"jvmByteCode":null,"text":"initial\n"} \ No newline at end of file +{"errors":{"File.kt":[{"interval":{"start":{"line":2,"ch":4},"end":{"line":2,"ch":7}},"message":"The 'var' property is never written to, so it can be declared as 'val'.","severity":"WARNING","className":"WARNING"},{"interval":{"start":{"line":4,"ch":8},"end":{"line":4,"ch":9}},"message":"Variable is unused.","severity":"WARNING","className":"WARNING"},{"interval":{"start":{"line":5,"ch":8},"end":{"line":5,"ch":9}},"message":"Variable is unused.","severity":"WARNING","className":"WARNING"}]},"exception":null,"jvmByteCode":null,"text":"initial\n"} \ No newline at end of file diff --git a/src/test/resources/test-compile-output/jvm/kotlin-web-site/basic-types/be5678589cf16c80d1cda9c85d9a55d9.1.json b/src/test/resources/test-compile-output/jvm/kotlin-web-site/basic-types/be5678589cf16c80d1cda9c85d9a55d9.1.json index 642f29ab..720fe5d2 100644 --- a/src/test/resources/test-compile-output/jvm/kotlin-web-site/basic-types/be5678589cf16c80d1cda9c85d9a55d9.1.json +++ b/src/test/resources/test-compile-output/jvm/kotlin-web-site/basic-types/be5678589cf16c80d1cda9c85d9a55d9.1.json @@ -1 +1 @@ -{"errors":{"File.kt":[{"interval":{"start":{"line":2,"ch":11},"end":{"line":2,"ch":14}},"message":"Redundant explicit type.","severity":"WARNING","className":"WARNING"},{"interval":{"start":{"line":6,"ch":11},"end":{"line":6,"ch":14}},"message":"Redundant explicit type.","severity":"WARNING","className":"WARNING"},{"interval":{"start":{"line":10,"ch":12},"end":{"line":10,"ch":36}},"message":"Identity equality for arguments of types 'kotlin.Int?' and 'kotlin.Int?' is prohibited.","severity":"WARNING","className":"WARNING"},{"interval":{"start":{"line":11,"ch":12},"end":{"line":11,"ch":36}},"message":"Identity equality for arguments of types 'kotlin.Int?' and 'kotlin.Int?' is prohibited.","severity":"WARNING","className":"WARNING"}]},"exception":null,"jvmByteCode":null,"text":"true\nfalse\n"} \ No newline at end of file +{"errors":{"File.kt":[{"interval":{"start":{"line":10,"ch":12},"end":{"line":10,"ch":36}},"message":"Identity equality for arguments of types 'kotlin.Int?' and 'kotlin.Int?' is prohibited.","severity":"WARNING","className":"WARNING"},{"interval":{"start":{"line":11,"ch":12},"end":{"line":11,"ch":36}},"message":"Identity equality for arguments of types 'kotlin.Int?' and 'kotlin.Int?' is prohibited.","severity":"WARNING","className":"WARNING"}]},"exception":null,"jvmByteCode":null,"text":"true\nfalse\n"} \ No newline at end of file diff --git a/src/test/resources/test-compile-output/jvm/kotlin-web-site/basic-types/be5678589cf16c80d1cda9c85d9a55d9.2.json b/src/test/resources/test-compile-output/jvm/kotlin-web-site/basic-types/be5678589cf16c80d1cda9c85d9a55d9.2.json index c80bc014..848c7a84 100644 --- a/src/test/resources/test-compile-output/jvm/kotlin-web-site/basic-types/be5678589cf16c80d1cda9c85d9a55d9.2.json +++ b/src/test/resources/test-compile-output/jvm/kotlin-web-site/basic-types/be5678589cf16c80d1cda9c85d9a55d9.2.json @@ -1 +1 @@ -{"errors":{"File.kt":[{"interval":{"start":{"line":2,"ch":11},"end":{"line":2,"ch":14}},"message":"Redundant explicit type.","severity":"WARNING","className":"WARNING"}]},"exception":null,"jvmByteCode":null,"text":"true\ntrue\n"} \ No newline at end of file +{"errors":{"File.kt":[]},"exception":null,"jvmByteCode":null,"text":"true\ntrue\n"} \ No newline at end of file diff --git a/src/test/resources/test-compile-output/jvm/kotlin-web-site/basic-types/be5678589cf16c80d1cda9c85d9a55d9.8.json b/src/test/resources/test-compile-output/jvm/kotlin-web-site/basic-types/be5678589cf16c80d1cda9c85d9a55d9.8.json index e6086721..78b28d5c 100644 --- a/src/test/resources/test-compile-output/jvm/kotlin-web-site/basic-types/be5678589cf16c80d1cda9c85d9a55d9.8.json +++ b/src/test/resources/test-compile-output/jvm/kotlin-web-site/basic-types/be5678589cf16c80d1cda9c85d9a55d9.8.json @@ -1 +1 @@ -{"errors":{"File.kt":[{"interval":{"start":{"line":2,"ch":16},"end":{"line":2,"ch":23}},"message":"Redundant explicit type.","severity":"WARNING","className":"WARNING"},{"interval":{"start":{"line":3,"ch":17},"end":{"line":3,"ch":24}},"message":"Redundant explicit type.","severity":"WARNING","className":"WARNING"},{"interval":{"start":{"line":4,"ch":8},"end":{"line":4,"ch":16}},"message":"Variable is unused.","severity":"WARNING","className":"WARNING"}]},"exception":null,"jvmByteCode":null,"text":"true\nfalse\nfalse\n"} \ No newline at end of file +{"errors":{"File.kt":[{"interval":{"start":{"line":4,"ch":8},"end":{"line":4,"ch":16}},"message":"Variable is unused.","severity":"WARNING","className":"WARNING"}]},"exception":null,"jvmByteCode":null,"text":"true\nfalse\nfalse\n"} \ No newline at end of file diff --git a/src/test/resources/test-compile-output/jvm/kotlin-web-site/basic-types/be5678589cf16c80d1cda9c85d9a55d9.9.json b/src/test/resources/test-compile-output/jvm/kotlin-web-site/basic-types/be5678589cf16c80d1cda9c85d9a55d9.9.json index 99ea39ed..2dc7ce9b 100644 --- a/src/test/resources/test-compile-output/jvm/kotlin-web-site/basic-types/be5678589cf16c80d1cda9c85d9a55d9.9.json +++ b/src/test/resources/test-compile-output/jvm/kotlin-web-site/basic-types/be5678589cf16c80d1cda9c85d9a55d9.9.json @@ -1 +1 @@ -{"errors":{"File.kt":[{"interval":{"start":{"line":2,"ch":15},"end":{"line":2,"ch":19}},"message":"Redundant explicit type.","severity":"WARNING","className":"WARNING"}]},"exception":null,"jvmByteCode":null,"text":"a\n\n\n＀\n"} \ No newline at end of file +{"errors":{"File.kt":[]},"exception":null,"jvmByteCode":null,"text":"a\n\n\n＀\n"} \ No newline at end of file diff --git a/src/test/resources/test-compile-output/jvm/kotlin-web-site/booleans/12bb120f56ea8aee70a72c46b1a1383f.1.json b/src/test/resources/test-compile-output/jvm/kotlin-web-site/booleans/12bb120f56ea8aee70a72c46b1a1383f.1.json index d36a156a..ef9d1ff0 100644 --- a/src/test/resources/test-compile-output/jvm/kotlin-web-site/booleans/12bb120f56ea8aee70a72c46b1a1383f.1.json +++ b/src/test/resources/test-compile-output/jvm/kotlin-web-site/booleans/12bb120f56ea8aee70a72c46b1a1383f.1.json @@ -1 +1 @@ -{"errors":{"File.kt":[{"interval":{"start":{"line":2,"ch":16},"end":{"line":2,"ch":23}},"message":"Redundant explicit type.","severity":"WARNING","className":"WARNING"},{"interval":{"start":{"line":3,"ch":17},"end":{"line":3,"ch":24}},"message":"Redundant explicit type.","severity":"WARNING","className":"WARNING"}]},"exception":null,"jvmByteCode":null,"text":"true\nfalse\nfalse\nnull\n"} \ No newline at end of file +{"errors":{"File.kt":[]},"exception":null,"jvmByteCode":null,"text":"true\nfalse\nfalse\nnull\n"} \ No newline at end of file diff --git a/src/test/resources/test-compile-output/jvm/kotlin-web-site/characters/8de4516ae10b8b417425b7e50699400b.1.json b/src/test/resources/test-compile-output/jvm/kotlin-web-site/characters/8de4516ae10b8b417425b7e50699400b.1.json index 99ea39ed..2dc7ce9b 100644 --- a/src/test/resources/test-compile-output/jvm/kotlin-web-site/characters/8de4516ae10b8b417425b7e50699400b.1.json +++ b/src/test/resources/test-compile-output/jvm/kotlin-web-site/characters/8de4516ae10b8b417425b7e50699400b.1.json @@ -1 +1 @@ -{"errors":{"File.kt":[{"interval":{"start":{"line":2,"ch":15},"end":{"line":2,"ch":19}},"message":"Redundant explicit type.","severity":"WARNING","className":"WARNING"}]},"exception":null,"jvmByteCode":null,"text":"a\n\n\n＀\n"} \ No newline at end of file +{"errors":{"File.kt":[]},"exception":null,"jvmByteCode":null,"text":"a\n\n\n＀\n"} \ No newline at end of file diff --git a/src/test/resources/test-compile-output/jvm/kotlin-web-site/kotlin-tour-basic-types/8d9f1ad7f4763df1c70051cd4e48a924.1.json b/src/test/resources/test-compile-output/jvm/kotlin-web-site/kotlin-tour-basic-types/8d9f1ad7f4763df1c70051cd4e48a924.1.json index 10cf4026..1299269b 100644 --- a/src/test/resources/test-compile-output/jvm/kotlin-web-site/kotlin-tour-basic-types/8d9f1ad7f4763df1c70051cd4e48a924.1.json +++ b/src/test/resources/test-compile-output/jvm/kotlin-web-site/kotlin-tour-basic-types/8d9f1ad7f4763df1c70051cd4e48a924.1.json @@ -1 +1 @@ -{"errors":{"File.kt":[{"interval":{"start":{"line":2,"ch":20},"end":{"line":2,"ch":22}},"message":"Initializer is redundant.","severity":"WARNING","className":"WARNING"},{"interval":{"start":{"line":7,"ch":14},"end":{"line":7,"ch":15}},"message":"Assignment can be replaced with operator assignment.","severity":"WARNING","className":"WARNING"}]},"exception":null,"jvmByteCode":null,"text":"10\n"} \ No newline at end of file +{"errors":{"File.kt":[{"interval":{"start":{"line":2,"ch":20},"end":{"line":2,"ch":22}},"message":"Initializer is redundant.","severity":"WARNING","className":"WARNING"}]},"exception":null,"jvmByteCode":null,"text":"10\n"} \ No newline at end of file diff --git a/src/test/resources/test-compile-output/jvm/kotlin-web-site/kotlin-tour-basic-types/8d9f1ad7f4763df1c70051cd4e48a924.2.json b/src/test/resources/test-compile-output/jvm/kotlin-web-site/kotlin-tour-basic-types/8d9f1ad7f4763df1c70051cd4e48a924.2.json index f5c2c25d..0e181627 100644 --- a/src/test/resources/test-compile-output/jvm/kotlin-web-site/kotlin-tour-basic-types/8d9f1ad7f4763df1c70051cd4e48a924.2.json +++ b/src/test/resources/test-compile-output/jvm/kotlin-web-site/kotlin-tour-basic-types/8d9f1ad7f4763df1c70051cd4e48a924.2.json @@ -1 +1 @@ -{"errors":{"File.kt":[{"interval":{"start":{"line":8,"ch":11},"end":{"line":8,"ch":17}},"message":"Redundant explicit type.","severity":"WARNING","className":"WARNING"}]},"exception":null,"jvmByteCode":null,"text":"3\nhello\n"} \ No newline at end of file +{"errors":{"File.kt":[]},"exception":null,"jvmByteCode":null,"text":"3\nhello\n"} \ No newline at end of file diff --git a/src/test/resources/test-compile-output/jvm/kotlin-web-site/numbers/f56d9449111795feee96b7f922b3320d.1.json b/src/test/resources/test-compile-output/jvm/kotlin-web-site/numbers/f56d9449111795feee96b7f922b3320d.1.json index 642f29ab..720fe5d2 100644 --- a/src/test/resources/test-compile-output/jvm/kotlin-web-site/numbers/f56d9449111795feee96b7f922b3320d.1.json +++ b/src/test/resources/test-compile-output/jvm/kotlin-web-site/numbers/f56d9449111795feee96b7f922b3320d.1.json @@ -1 +1 @@ -{"errors":{"File.kt":[{"interval":{"start":{"line":2,"ch":11},"end":{"line":2,"ch":14}},"message":"Redundant explicit type.","severity":"WARNING","className":"WARNING"},{"interval":{"start":{"line":6,"ch":11},"end":{"line":6,"ch":14}},"message":"Redundant explicit type.","severity":"WARNING","className":"WARNING"},{"interval":{"start":{"line":10,"ch":12},"end":{"line":10,"ch":36}},"message":"Identity equality for arguments of types 'kotlin.Int?' and 'kotlin.Int?' is prohibited.","severity":"WARNING","className":"WARNING"},{"interval":{"start":{"line":11,"ch":12},"end":{"line":11,"ch":36}},"message":"Identity equality for arguments of types 'kotlin.Int?' and 'kotlin.Int?' is prohibited.","severity":"WARNING","className":"WARNING"}]},"exception":null,"jvmByteCode":null,"text":"true\nfalse\n"} \ No newline at end of file +{"errors":{"File.kt":[{"interval":{"start":{"line":10,"ch":12},"end":{"line":10,"ch":36}},"message":"Identity equality for arguments of types 'kotlin.Int?' and 'kotlin.Int?' is prohibited.","severity":"WARNING","className":"WARNING"},{"interval":{"start":{"line":11,"ch":12},"end":{"line":11,"ch":36}},"message":"Identity equality for arguments of types 'kotlin.Int?' and 'kotlin.Int?' is prohibited.","severity":"WARNING","className":"WARNING"}]},"exception":null,"jvmByteCode":null,"text":"true\nfalse\n"} \ No newline at end of file diff --git a/src/test/resources/test-compile-output/jvm/kotlin-web-site/numbers/f56d9449111795feee96b7f922b3320d.2.json b/src/test/resources/test-compile-output/jvm/kotlin-web-site/numbers/f56d9449111795feee96b7f922b3320d.2.json index c80bc014..848c7a84 100644 --- a/src/test/resources/test-compile-output/jvm/kotlin-web-site/numbers/f56d9449111795feee96b7f922b3320d.2.json +++ b/src/test/resources/test-compile-output/jvm/kotlin-web-site/numbers/f56d9449111795feee96b7f922b3320d.2.json @@ -1 +1 @@ -{"errors":{"File.kt":[{"interval":{"start":{"line":2,"ch":11},"end":{"line":2,"ch":14}},"message":"Redundant explicit type.","severity":"WARNING","className":"WARNING"}]},"exception":null,"jvmByteCode":null,"text":"true\ntrue\n"} \ No newline at end of file +{"errors":{"File.kt":[]},"exception":null,"jvmByteCode":null,"text":"true\ntrue\n"} \ No newline at end of file