parent
028176a4b6
commit
a3ecc9f2d4
2 changed files with 9 additions and 2 deletions
|
@ -124,8 +124,7 @@ impl<T: Iterator<Item=char>> Parser<T> {
|
|||
|
||||
fn parse<R: EventReceiver>(&mut self, recv: &mut R)
|
||||
-> ParseResult {
|
||||
if self.scanner.stream_ended()
|
||||
|| self.state == State::End {
|
||||
if self.state == State::End {
|
||||
return Ok(Event::StreamEnd);
|
||||
}
|
||||
let ev = try!(self.state_machine());
|
||||
|
|
|
@ -331,6 +331,14 @@ c: [1, 2]
|
|||
assert!(doc["d"][0].is_badvalue());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_empty_doc() {
|
||||
let s: String = "".to_owned();
|
||||
YamlLoader::load_from_str(&s).unwrap();
|
||||
let s: String = "---".to_owned();
|
||||
assert_eq!(YamlLoader::load_from_str(&s).unwrap()[0], Yaml::Null);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_parser() {
|
||||
let s: String = "
|
||||
|
|
Loading…
Reference in a new issue