From 1430bf91a8db4aa92fadc853148d85be0fdffeea Mon Sep 17 00:00:00 2001 From: Ilya Goncharov Date: Fri, 25 Aug 2023 12:07:15 +0200 Subject: [PATCH] Remove legacy tests --- .../server/CommandLineArgumentsTest.kt | 18 ----------- .../compiler/server/ConvertToJsRunnerTest.kt | 30 ------------------- 2 files changed, 48 deletions(-) diff --git a/src/test/kotlin/com/compiler/server/CommandLineArgumentsTest.kt b/src/test/kotlin/com/compiler/server/CommandLineArgumentsTest.kt index c4447ce92..ce8d21afc 100644 --- a/src/test/kotlin/com/compiler/server/CommandLineArgumentsTest.kt +++ b/src/test/kotlin/com/compiler/server/CommandLineArgumentsTest.kt @@ -23,15 +23,6 @@ class CommandLineArgumentsTest : BaseExecutorTest() { ) } - @Test - fun `command line arguments js test`() { - runJs( - code = "fun main(args: Array) {\n println(args[0])\n println(args[1])\n}", - args = "0 1", - contains = "main(['0', '1']);" - ) - } - @Test fun `command line arguments js ir test`() { runJsIr( @@ -41,15 +32,6 @@ class CommandLineArgumentsTest : BaseExecutorTest() { ) } - @Test - fun `command line string arguments js test`() { - runJs( - code = "fun main(args: Array) {\n println(args[0])\n println(args[1])\n}", - args = "alex1 alex2", - contains = "main(['alex1', 'alex2']);" - ) - } - @Test fun `command line string arguments js ir test`() { runJsIr( diff --git a/src/test/kotlin/com/compiler/server/ConvertToJsRunnerTest.kt b/src/test/kotlin/com/compiler/server/ConvertToJsRunnerTest.kt index fbf9b25ae..3ab5567d8 100644 --- a/src/test/kotlin/com/compiler/server/ConvertToJsRunnerTest.kt +++ b/src/test/kotlin/com/compiler/server/ConvertToJsRunnerTest.kt @@ -3,36 +3,6 @@ package com.compiler.server import com.compiler.server.base.BaseExecutorTest import org.junit.jupiter.api.Test -class ConvertToJsRunnerTest : BaseExecutorTest() { - - @Test - fun `base execute test`() { - runJs( - code = "fun main() {\n println(\"Hello, world!!!\")\n}", - contains = "println('Hello, world!!!');" - ) - } - - @Test - fun `base execute test multi`() { - runJs( - code = listOf( - "import cat.Cat\n\nfun main(args: Array) {\nval cat = Cat(\"Kitty\")\nprintln(cat.name)\n}", - "package cat\n class Cat(val name: String)" - ), - contains = "var cat = new Cat('Kitty');" - ) - } - - @Test - fun `canvas with jquery test`() { - runJs( - code = "package fancylines\n\n\nimport org.w3c.dom.CanvasRenderingContext2D\nimport org.w3c.dom.HTMLCanvasElement\nimport kotlinx.browser.document\nimport kotlinx.browser.window\nimport kotlin.random.Random\n\n\n\nval canvas = initalizeCanvas()\nfun initalizeCanvas(): HTMLCanvasElement {\n val canvas = document.createElement(\"canvas\") as HTMLCanvasElement\n val context = canvas.getContext(\"2d\") as CanvasRenderingContext2D\n context.canvas.width = window.innerWidth.toInt();\n context.canvas.height = window.innerHeight.toInt();\n document.body!!.appendChild(canvas)\n return canvas\n}\n\nclass FancyLines() {\n val context = canvas.getContext(\"2d\") as CanvasRenderingContext2D\n val height = canvas.height\n val width = canvas.width\n var x = width * Random.nextDouble()\n var y = height * Random.nextDouble()\n var hue = 0;\n\n fun line() {\n context.save();\n\n context.beginPath();\n\n context.lineWidth = 20.0 * Random.nextDouble();\n context.moveTo(x, y);\n\n x = width * Random.nextDouble();\n y = height * Random.nextDouble();\n\n context.bezierCurveTo(width * Random.nextDouble(), height * Random.nextDouble(),\n width * Random.nextDouble(), height * Random.nextDouble(), x, y);\n\n hue += (Random.nextDouble() * 10).toInt();\n\n context.strokeStyle = \"hsl(\$hue, 50%, 50%)\";\n\n context.shadowColor = \"white\";\n context.shadowBlur = 10.0;\n\n context.stroke();\n\n context.restore();\n }\n\n fun blank() {\n context.fillStyle = \"rgba(255,255,1,0.1)\";\n context.fillRect(0.0, 0.0, width.toDouble(), height.toDouble());\n }\n\n fun run() {\n window.setInterval({ line() }, 40);\n window.setInterval({ blank() }, 100);\n }\n}\nfun main(args: Array) {\n FancyLines().run()\n}", - contains = "this.context = Kotlin.isType(tmp\$ = canvas.getContext('2d'), CanvasRenderingContext2D) ? tmp\$ : throwCCE();", - ) - } -} - class ConvertToJsIrRunnerTest : BaseExecutorTest() { @Test fun `base execute test`() {