-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support declarations of operations, global parameters, and operation …
…groups in parent classes
- Loading branch information
Showing
2 changed files
with
42 additions
and
10 deletions.
There are no files selected for viewing
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
22 changes: 22 additions & 0 deletions
22
lincheck/src/test/java/org/jetbrains/kotlinx/lincheck/test/OperationsInAbstractClassTest.kt
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,22 @@ | ||
package org.jetbrains.kotlinx.lincheck.test | ||
|
||
import org.jetbrains.kotlinx.lincheck.* | ||
import org.jetbrains.kotlinx.lincheck.annotations.* | ||
import org.jetbrains.kotlinx.lincheck.strategy.stress.* | ||
import org.junit.* | ||
import java.lang.AssertionError | ||
import kotlin.random.* | ||
|
||
@StressCTest(iterations = 1, minimizeFailedScenario = false, requireStateEquivalenceImplCheck = false) | ||
class OperationsInAbstractClassTest : AbstractTestClass() { | ||
@Operation | ||
fun goodOperation() = 10 | ||
|
||
@Test(expected = AssertionError::class) | ||
fun test(): Unit = LinChecker.check(this::class.java) | ||
} | ||
|
||
open class AbstractTestClass { | ||
@Operation | ||
fun badOperation() = Random.nextInt(10) | ||
} |