aboutsummaryrefslogtreecommitdiff
path: root/test-suite/tests/invalid-misc.rs
blob: 5c7f779b51bc5adfcd55f6d2cc9641231c4fa40f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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_");
    bad("''");
    bad("a = 9e99999");

    bad("a = \"\u{7f}\"");
    bad("a = '\u{7f}'");

    bad("a = -0x1");
    bad("a = 0x-1");

    // Dotted keys.
    bad("a.b.c = 1
         a.b = 2
        ");
    bad("a = 1
         a.b = 2");
    bad("a = {k1 = 1, k1.name = \"joe\"}")
}