Css parse failures should return a ParamFailure containing the parser' failure message #1321

Closed
wants to merge 1 commit into
from
View
2 core/util/src/main/scala/net/liftweb/util/CssSelector.scala
@@ -151,7 +151,7 @@ object CssSelectorParser extends PackratParsers with ImplicitConversions {
val reader: Input = new CharSequenceReader(toParse, 0)
topParser(reader) match {
case Success(v, _) => Full(v)
- case x => Empty
+ case x: NoSuccess => ParamFailure(x.msg, Empty, Empty, x)
}
}
View
2 core/util/src/test/scala/net/liftweb/util/CssSelectorSpec.scala
@@ -30,7 +30,7 @@ object CssSelectorSpec extends Specification {
"CssSelector" should {
"fail for garbage input" in {
- CssSelectorParser.parse(" 49234e23") must_== Empty
+ CssSelectorParser.parse(" 49234e23").isDefined must_== false
}
"select an id" in {