Skip to content

Commit

Permalink
enkel boolean parser
Browse files Browse the repository at this point in the history
  • Loading branch information
eirikm committed Aug 12, 2024
1 parent 2941df4 commit c3e8c20
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions simple-parsers/src/test/scala/SimpleParsers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,15 @@ class SimpleParsers extends ParserSuite {

assertParsesValid(p, validInputs*)
}

test("boolean") {
val validInputs = List(
"true" -> true,
"false" -> false
)

val p: Parser[Boolean] = Parser.string("true").as(true) | Parser.string("false").as(false)

assertParses(p, validInputs*)
}
}

0 comments on commit c3e8c20

Please sign in to comment.