LV 2.0: update some CLI tests with warnings to use DIVISION_BY_ZERO warning

This commit is contained in:
Mikhail Glukhikh
2023-09-15 16:53:04 +02:00
committed by Space Team
parent e5906a8a3a
commit e4b70e7788
10 changed files with 22 additions and 41 deletions
@@ -1,5 +1,5 @@
package kotlin
fun main() {
val x = 1?.dec()
fun foo(arg: Int) {
val x = arg / 0
}
@@ -1 +1,4 @@
compiler/testData/cli/jvm/readingConfigFromEnvironment/appendingArgs.kt:4:13: warning: [DIVISION_BY_ZERO] Division by zero.
val x = arg / 0
^
OK
-1
View File
@@ -1,5 +1,4 @@
$TESTDATA_DIR$/werror.kt
-d
$TEMP_DIR$
-XXLanguage\:+EnableDfaWarningsInK2
-Werror
+3 -3
View File
@@ -1,4 +1,4 @@
fun foo(s: String, t: String?) {
s!!
t?.toString()
fun foo(a: Int, b: Int) {
println(a / 0)
println(b / 0)
}
+6 -12
View File
@@ -1,14 +1,8 @@
warning: ATTENTION!
This build uses unsafe internal compiler arguments:
-XXLanguage:+EnableDfaWarningsInK2
This mode is not recommended for production use,
as no stability/compatibility guarantees are given on
compiler or generated code. Use it at your own risk!
error: warnings found and -Werror specified
compiler/testData/cli/jvm/werror.kt:2:6: warning: unnecessary non-null assertion (!!) on a non-null receiver of type 'kotlin/String'.
s!!
^
compiler/testData/cli/jvm/werror.kt:2:13: warning: division by zero.
println(a / 0)
^
compiler/testData/cli/jvm/werror.kt:3:13: warning: division by zero.
println(b / 0)
^
COMPILATION_ERROR
+1 -2
View File
@@ -1,6 +1,5 @@
$TESTDATA_DIR$/werrorWithNoWarn.kt
$TESTDATA_DIR$/werror.kt
-d
$TEMP_DIR$
-XXLanguage\:+EnableDfaWarningsInK2
-Werror
-nowarn
-4
View File
@@ -1,4 +0,0 @@
fun foo(s: String, t: String?) {
s!!
t?.toString()
}
+6 -12
View File
@@ -1,14 +1,8 @@
warning: ATTENTION!
This build uses unsafe internal compiler arguments:
-XXLanguage:+EnableDfaWarningsInK2
This mode is not recommended for production use,
as no stability/compatibility guarantees are given on
compiler or generated code. Use it at your own risk!
error: warnings found and -Werror specified
compiler/testData/cli/jvm/werrorWithNoWarn.kt:2:6: warning: unnecessary non-null assertion (!!) on a non-null receiver of type 'kotlin/String'.
s!!
^
compiler/testData/cli/jvm/werror.kt:2:13: warning: division by zero.
println(a / 0)
^
compiler/testData/cli/jvm/werror.kt:3:13: warning: division by zero.
println(b / 0)
^
COMPILATION_ERROR
+1 -1
View File
@@ -1,4 +1,4 @@
$TESTDATA_DIR$/werrorWithStrongWarning.kt
$TESTDATA_DIR$/werror.kt
-Xdisable-default-scripting-plugin
-d
$TEMP_DIR$
-4
View File
@@ -1,4 +0,0 @@
fun foo(s: String, t: String?) {
s!!
t?.toString()
}