-
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.
Exception message when no operations defined impoved (#233)
--------- Co-authored-by: Aleksandr.Potapov <[email protected]>
- Loading branch information
1 parent
6c145be
commit 1541474
Showing
2 changed files
with
40 additions
and
1 deletion.
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
31 changes: 31 additions & 0 deletions
31
src/jvm/test/org/jetbrains/kotlinx/lincheck_test/representation/NoOperationsDefinedTest.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,31 @@ | ||
/* | ||
* Lincheck | ||
* | ||
* Copyright (C) 2019 - 2023 JetBrains s.r.o. | ||
* | ||
* This Source Code Form is subject to the terms of the | ||
* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed | ||
* with this file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
package org.jetbrains.kotlinx.lincheck_test.representation | ||
|
||
import org.jetbrains.kotlinx.lincheck.NO_OPERATION_ERROR_MESSAGE | ||
import org.jetbrains.kotlinx.lincheck.check | ||
import org.jetbrains.kotlinx.lincheck.strategy.managed.modelchecking.ModelCheckingOptions | ||
import org.junit.Assert.assertEquals | ||
import org.junit.Assert.assertThrows | ||
import org.junit.Test | ||
|
||
/** | ||
* This class is used to test the exception message when no operations are defined in a tested class. | ||
*/ | ||
class NoOperationsDefinedTest { | ||
|
||
@Test | ||
fun test() { | ||
val exception = assertThrows(IllegalStateException::class.java) { ModelCheckingOptions().check(this::class) } | ||
assertEquals(NO_OPERATION_ERROR_MESSAGE, exception.message) | ||
} | ||
|
||
} |