From 2cf411eaeaf6d5b9ee2a7abeb0f921c16f89d643 Mon Sep 17 00:00:00 2001 From: James Strachan Date: Wed, 25 Jul 2012 04:05:28 -0400 Subject: [PATCH] added a test case for KT-2515 --- .../k2js/test/semantics/InvokeMethodTest.java | 30 +++++++++++++++++++ .../expression/invoke/cases/invokeMethod.kt | 12 ++++++++ 2 files changed, 42 insertions(+) create mode 100644 js/js.tests/test/org/jetbrains/k2js/test/semantics/InvokeMethodTest.java create mode 100644 js/js.translator/testFiles/expression/invoke/cases/invokeMethod.kt diff --git a/js/js.tests/test/org/jetbrains/k2js/test/semantics/InvokeMethodTest.java b/js/js.tests/test/org/jetbrains/k2js/test/semantics/InvokeMethodTest.java new file mode 100644 index 00000000000..a9da756a22c --- /dev/null +++ b/js/js.tests/test/org/jetbrains/k2js/test/semantics/InvokeMethodTest.java @@ -0,0 +1,30 @@ +/* + * Copyright 2010-2012 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.k2js.test.semantics; + +public final class InvokeMethodTest extends AbstractExpressionTest { + + public InvokeMethodTest() { + super("invoke/"); + } + + public void testInvokeMethod() throws Exception { + // TODO uncomment this method to make the test case fail + // fooBoxIsValue("hello world!"); + } + +} \ No newline at end of file diff --git a/js/js.translator/testFiles/expression/invoke/cases/invokeMethod.kt b/js/js.translator/testFiles/expression/invoke/cases/invokeMethod.kt new file mode 100644 index 00000000000..62471ada5df --- /dev/null +++ b/js/js.translator/testFiles/expression/invoke/cases/invokeMethod.kt @@ -0,0 +1,12 @@ +package foo + +class Foo(val postfix: String) { + public fun invoke(text: String): String { + return text + postfix + } +} + +fun box() : String { + val a = Foo(" world!") + return a("hello") +} \ No newline at end of file