aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-01-19 13:16:42 -0800
committerAlex Crichton <alex@alexcrichton.com>2015-01-19 13:16:42 -0800
commit885db13d09f5beb721e215942d1423f4122093e0 (patch)
treecef1685a727395a45254dcb26e428d848e15b84d /src
parent34aaa5f38498ccb2eef53e67c742ceaa2c80865d (diff)
downloadmilf-rs-885db13d09f5beb721e215942d1423f4122093e0.tar.gz
milf-rs-885db13d09f5beb721e215942d1423f4122093e0.zip
Don't infinite loop on bad keys
Diffstat (limited to 'src')
-rw-r--r--src/parser.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/parser.rs b/src/parser.rs
index df19ba4..8065aa8 100644
--- a/src/parser.rs
+++ b/src/parser.rs
@@ -220,7 +220,7 @@ impl<'a> Parser<'a> {
_ => break,
}
}
- None => {}
+ None => break
}
}
Some(ret)
@@ -1135,4 +1135,9 @@ trimmed in raw strings.
assert!(table.lookup("f f").is_some());
assert!(table.lookup("\"").is_some());
}
+
+ #[test]
+ fn invalid_bare_numeral() {
+ assert!(Parser::new("4").parse().is_none());
+ }
}