Browse files

Css: Parse failures return ParamFailure, not Empty

  • Loading branch information...
1 parent f35e4e0 commit e5e3f7e7e9bf309ae3a8c3438af012dbf12fd4cf @nafg nafg committed Sep 19, 2012
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
@@ -33,7 +33,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 {

0 comments on commit e5e3f7e

Please sign in to comment.