Skip to content

Commit 17313eb

Browse files
authored
Add validation test for Kotlin lambda expressions (bazel-contrib#1005)
1 parent 7c41be6 commit 17313eb

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2009, 2020 Mountainminds GmbH & Co. KG and Contributors
3+
* This program and the accompanying materials are made available under
4+
* the terms of the Eclipse Public License 2.0 which is available at
5+
* http://www.eclipse.org/legal/epl-2.0
6+
*
7+
* SPDX-License-Identifier: EPL-2.0
8+
*
9+
* Contributors:
10+
* Evgeny Mandrikov - initial API and implementation
11+
*
12+
*******************************************************************************/
13+
package org.jacoco.core.test.validation.kotlin;
14+
15+
import org.jacoco.core.test.validation.ValidationTestBase;
16+
import org.jacoco.core.test.validation.kotlin.targets.KotlinLambdaExpressionsTarget;
17+
18+
/**
19+
* Test of code coverage in {@link KotlinLambdaExpressionsTarget}.
20+
*/
21+
public class KotlinLambdaExpressionsTest extends ValidationTestBase {
22+
23+
public KotlinLambdaExpressionsTest() {
24+
super(KotlinLambdaExpressionsTarget.class);
25+
}
26+
27+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2009, 2020 Mountainminds GmbH & Co. KG and Contributors
3+
* This program and the accompanying materials are made available under
4+
* the terms of the Eclipse Public License 2.0 which is available at
5+
* http://www.eclipse.org/legal/epl-2.0
6+
*
7+
* SPDX-License-Identifier: EPL-2.0
8+
*
9+
* Contributors:
10+
* Evgeny Mandrikov - initial API and implementation
11+
*
12+
*******************************************************************************/
13+
package org.jacoco.core.test.validation.kotlin.targets
14+
15+
import org.jacoco.core.test.validation.targets.Stubs.*
16+
17+
/**
18+
* This test target contains different lambda expressions.
19+
*/
20+
object KotlinLambdaExpressionsTarget {
21+
22+
@JvmStatic
23+
fun main(args: Array<String>) {
24+
25+
exec { // assertFullyCovered()
26+
nop() // assertFullyCovered()
27+
} // assertFullyCovered()
28+
29+
noexec { // assertFullyCovered()
30+
nop() // assertNotCovered()
31+
} // assertNotCovered()
32+
33+
noexec { nop() } // assertPartlyCovered()
34+
35+
}
36+
37+
}

0 commit comments

Comments
 (0)