Created
September 14, 2015 09:21
-
-
Save hohl/3daae9b77eb1b02e175e to your computer and use it in GitHub Desktop.
Why does this single test case fail, while others work as expected?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ... | |
lazy val prefix: Parser[Prefix] = | |
(host | nick) ~ opt('!' ~> user) ~ opt('@' ~> host) ^^ { | |
case t ~ u ~ s => Prefix(t, u, s) | |
} | |
lazy val host = """[a-zA-Z0-9.:\-^_\-\[\]\\/`]+""".r | |
lazy val nick = """(\p{L}|[0-9]|[-_\[\]\\`^\{\}\|])+""".r | |
lazy val user = """[^(\s|@)]+""".r | |
// ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ... | |
"be able to parse nicks with vertical bars (they are in use even if they are not allowed by RFC1459 or RFC2813)" in { | |
val prefix = "Miho|[email protected]" | |
val successfullyParsed = Parser.parseAll(Parser.prefix, prefix) match { | |
case Parser.Success(Prefix("Miho|Zzz", Some("~Miho"), Some("191.ip-149-202-42.eu")), _) => | |
true | |
case x => | |
false | |
} | |
successfullyParsed must beTrue | |
} | |
// ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment