forked from bazelbuild/rules_scala
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Anonymous functions in Scala should not be filtered out (bazelbuild#912)
- Loading branch information
Showing
5 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
...alidation.scala/src/org/jacoco/core/test/validation/scala/ScalaAnonymousFunctionTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Evgeny Mandrikov - initial API and implementation | ||
* | ||
*******************************************************************************/ | ||
package org.jacoco.core.test.validation.scala; | ||
|
||
import org.jacoco.core.test.validation.ValidationTestBase; | ||
import org.jacoco.core.test.validation.scala.targets.ScalaAnonymousFunctionTarget; | ||
|
||
/** | ||
* Test of anonymous functions. | ||
*/ | ||
public class ScalaAnonymousFunctionTest extends ValidationTestBase { | ||
|
||
public ScalaAnonymousFunctionTest() { | ||
super(ScalaAnonymousFunctionTarget.class); | ||
} | ||
|
||
} |
33 changes: 33 additions & 0 deletions
33
...cala/src/org/jacoco/core/test/validation/scala/targets/ScalaAnonymousFunctionTarget.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Evgeny Mandrikov - initial API and implementation | ||
* | ||
*******************************************************************************/ | ||
package org.jacoco.core.test.validation.scala.targets | ||
|
||
import org.jacoco.core.test.validation.targets.Stubs.{exec, noexec, nop} | ||
|
||
/** | ||
* Test target for anonymous functions. | ||
*/ | ||
object ScalaAnonymousFunctionTarget { | ||
|
||
def main(args: Array[String]): Unit = { | ||
|
||
exec(() => { | ||
nop() // assertFullyCovered() | ||
}) | ||
|
||
noexec(() => { | ||
nop() // assertNotCovered() | ||
}) | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters