Add a CRLF test

This commit is contained in:
Alex Crichton 2014-06-25 07:00:10 -07:00
parent 66c83483f8
commit caf4071137

View file

@ -683,6 +683,23 @@ impl<'a> Parser<'a> {
mod tests { mod tests {
use super::Parser; use super::Parser;
#[test]
fn crlf() {
let mut p = Parser::new("\
[project]\r\n\
\r\n\
name = \"splay\"\r\n\
version = \"0.1.0\"\r\n\
authors = [\"alex@crichton.co\"]\r\n\
\r\n\
[[lib]]\r\n\
\r\n\
path = \"lib.rs\"\r\n\
name = \"splay\"\r\n\
");
assert!(p.parse().is_some());
}
#[test] #[test]
fn linecol() { fn linecol() {
let p = Parser::new("ab\ncde\nf"); let p = Parser::new("ab\ncde\nf");