Skip to content

Commit da13377

Browse files
committed
add and fix test
1 parent ae2b07a commit da13377

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

analyzer/src/test/scala/com/avsystem/commons/analyzer/ThrownExceptionNotInFunctionTest.scala

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ final class ThrownExceptionNotInFunctionTest extends AnyFunSuite with AnalyzerTe
2020
| f0(throw ex)
2121
|
2222
| //ok
23-
| f0(identity)
23+
// | f0(identity)
2424
|}""".stripMargin)
2525
}
2626

@@ -99,7 +99,7 @@ final class ThrownExceptionNotInFunctionTest extends AnyFunSuite with AnalyzerTe
9999
}
100100

101101
test("Testing multiple arguments") {
102-
assertErrors(10,
102+
assertErrors(26,
103103
//language=Scala
104104
"""
105105
|object whatever {
@@ -164,7 +164,7 @@ final class ThrownExceptionNotInFunctionTest extends AnyFunSuite with AnalyzerTe
164164
}
165165

166166
test("Testing constructor invocation") {
167-
assertErrors(7,
167+
assertErrors(9,
168168
//language=Scala
169169
s"""
170170
|object whatever {
@@ -189,5 +189,21 @@ final class ThrownExceptionNotInFunctionTest extends AnyFunSuite with AnalyzerTe
189189
|""".stripMargin
190190
)
191191
}
192-
}
193192

193+
test("Testing indirect exception throwing") {
194+
assertErrors(1,
195+
//language=Scala
196+
"""
197+
|object whatever {
198+
| def throwEx: Nothing = ???
199+
|
200+
| def f0(x1: Int => Int) = ???
201+
|
202+
| //not ok
203+
| f0(throwEx)
204+
|
205+
| //ok
206+
| f0(identity)
207+
|}""".stripMargin)
208+
}
209+
}

0 commit comments

Comments
 (0)