Skip to content

Commit

Permalink
add and fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
halotukozak committed Jun 24, 2024
1 parent ae2b07a commit da13377
Showing 1 changed file with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ final class ThrownExceptionNotInFunctionTest extends AnyFunSuite with AnalyzerTe
| f0(throw ex)
|
| //ok
| f0(identity)
// | f0(identity)
|}""".stripMargin)
}

Expand Down Expand Up @@ -99,7 +99,7 @@ final class ThrownExceptionNotInFunctionTest extends AnyFunSuite with AnalyzerTe
}

test("Testing multiple arguments") {
assertErrors(10,
assertErrors(26,
//language=Scala
"""
|object whatever {
Expand Down Expand Up @@ -164,7 +164,7 @@ final class ThrownExceptionNotInFunctionTest extends AnyFunSuite with AnalyzerTe
}

test("Testing constructor invocation") {
assertErrors(7,
assertErrors(9,
//language=Scala
s"""
|object whatever {
Expand All @@ -189,5 +189,21 @@ final class ThrownExceptionNotInFunctionTest extends AnyFunSuite with AnalyzerTe
|""".stripMargin
)
}
}

test("Testing indirect exception throwing") {
assertErrors(1,
//language=Scala
"""
|object whatever {
| def throwEx: Nothing = ???
|
| def f0(x1: Int => Int) = ???
|
| //not ok
| f0(throwEx)
|
| //ok
| f0(identity)
|}""".stripMargin)
}
}

0 comments on commit da13377

Please sign in to comment.