forked from JetBrains/kotlin
-
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.
added tests for check with empty implementation
- Loading branch information
1 parent
a7db208
commit 6655d34
Showing
4 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
...al-verification/testData/diagnostics/good_contracts/stdlib_replacement_tests.fir.diag.txt
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,16 @@ | ||
/stdlib_replacement_tests.kt:(151,160): info: Generated Viper text for useRepeat: | ||
method global$fun_useRepeat$fun_take$$return$T_Unit() returns (ret$0: Ref) | ||
ensures dom$RuntimeType$isSubtype(dom$RuntimeType$typeOf(ret$0), dom$RuntimeType$unitType()) | ||
ensures true | ||
{ | ||
var ret$1: Ref | ||
var anonymous$0: Ref | ||
var ret$2: Ref | ||
var anonymous$1: Ref | ||
ret$0 := dom$RuntimeType$unitValue() | ||
anonymous$0 := dom$RuntimeType$boolToRef(true) | ||
label label$ret$1 | ||
anonymous$1 := dom$RuntimeType$boolToRef(true) | ||
label label$ret$2 | ||
label label$ret$0 | ||
} |
17 changes: 17 additions & 0 deletions
17
plugins/formal-verification/testData/diagnostics/good_contracts/stdlib_replacement_tests.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,17 @@ | ||
// REPLACE_STDLIB_EXTENSIONS | ||
|
||
import kotlin.contracts.contract | ||
import kotlin.contracts.ExperimentalContracts | ||
|
||
@OptIn(ExperimentalContracts::class) | ||
fun <!VIPER_TEXT!>useRepeat<!>(): Unit { | ||
contract { | ||
returns() | ||
} | ||
check(true) | ||
check(true) { "Lazy message" } | ||
} | ||
|
||
// TODO: add test for `repeat` (we actually have a bug there because we require unsatisfied precondition in loops) | ||
|
||
// TODO: add tests for `let`, `apply`, `with`, `run`, `also` |
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
6 changes: 6 additions & 0 deletions
6
...ains/kotlin/formver/plugin/runners/FirLightTreeFormVerPluginDiagnosticsTestGenerated.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.