Skip to content

Commit

Permalink
Adjust tests and implementation to satisfy coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
keynmol committed Apr 10, 2024
1 parent f5d9cd3 commit 269bd1d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
1 change: 0 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ lazy val tests = project
(publish / skip) := true,
testFrameworks := List(new TestFramework("munit.Framework")),
buildInfoPackage := "tests",
//scalacOptions ++= "-Ymacro-debug-verbose Yshow-trees-compact -Vprint".split(" ").toList,
buildInfoKeys :=
Seq[BuildInfoKey](
"expectDirectory" -> (Test / sourceDirectory).value./("expect")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ final class InputTransformer[J](input: Input) extends CharParser[J] {
}

override def reject(j: Int): PartialFunction[Throwable, Nothing] = {
case e: IndexOutOfBoundsException =>
case e: StringIndexOutOfBoundsException =>

Check warning on line 43 in moped/src/main/scala/moped/internal/transformers/InputTransformer.scala

View check run for this annotation

Codecov / codecov/patch

moped/src/main/scala/moped/internal/transformers/InputTransformer.scala#L43

Added line #L43 was not covered by tests
val n = chars.length - 1
val pos = RangePosition(input, n, n)
throw new DiagnosticException(Diagnostic.error("incomplete JSON", pos))
Expand Down Expand Up @@ -124,11 +124,7 @@ final class InputTransformer[J](input: Input) extends CharParser[J] {
throw new StringIndexOutOfBoundsException(i)
chars(i)
}
def at(i: Int, j: Int): CharSequence = wrapped.subSequence(i, j)
override def atEof(i: Int): Boolean = i >= chars.length
def close(): Unit = ()
override def close(): Unit = ()
override def dropBufferUntil(i: Int): Unit = ()
final def char(i: Int): Char =
chars(i) //upickle.core.Platform.charAt(chars, i)
// final def sliceString(i: Int, j: Int): CharSequence = chars.subsequence(i, j)
}
6 changes: 4 additions & 2 deletions tests/src/test/scala/tests/ConfigCommandSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ class ConfigCommandSuite extends BaseSuite {
checkErrorOutput(
"json-error",
List("config"),
"""|error: exhausted input
"""|error: /workingDirectory/.tests.json:1 error: expected false
|filse
|^
|""".stripMargin,
workingDirectoryLayout =
"""|/.tests.json
|{
|filse
|""".stripMargin
)

Expand Down

0 comments on commit 269bd1d

Please sign in to comment.