2017-01-29 18:53:20 -06:00
|
|
|
extern crate toml;
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn bad() {
|
|
|
|
fn bad(s: &str) {
|
|
|
|
assert!(s.parse::<toml::Value>().is_err());
|
|
|
|
}
|
|
|
|
|
|
|
|
bad("a = 01");
|
|
|
|
bad("a = 1__1");
|
|
|
|
bad("a = 1_");
|
2017-02-21 22:27:43 -06:00
|
|
|
bad("''");
|
2017-05-30 18:07:15 -05:00
|
|
|
bad("a = 9e99999");
|
2018-07-10 20:00:12 -05:00
|
|
|
|
2018-07-10 20:13:06 -05:00
|
|
|
bad("a = \"\u{7f}\"");
|
|
|
|
bad("a = '\u{7f}'");
|
2018-07-10 20:00:12 -05:00
|
|
|
|
|
|
|
bad("a = -0x1");
|
|
|
|
bad("a = 0x-1");
|
2018-07-11 01:29:47 -05:00
|
|
|
|
|
|
|
// Dotted keys.
|
|
|
|
bad("a.b.c = 1
|
|
|
|
a.b = 2
|
|
|
|
");
|
|
|
|
bad("a = 1
|
|
|
|
a.b = 2");
|
|
|
|
bad("a = {k1 = 1, k1.name = \"joe\"}")
|
2017-01-29 18:53:20 -06:00
|
|
|
}
|