From 3536cb50e646a8a9e5f26dce9a25bab101793126 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 15 Jan 2015 19:47:14 -0800 Subject: Update key syntax to TOML master * Bare keys contain a very limited set of characters now. * Keys in quotes behave the same as basic strings. Closes #47 --- tests/invalid.rs | 2 +- tests/valid/hard_example.toml | 2 +- tests/valid/table-whitespace.toml | 2 +- tests/valid/table-with-pound.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/invalid.rs b/tests/invalid.rs index 582e25d..3df4d02 100644 --- a/tests/invalid.rs +++ b/tests/invalid.rs @@ -5,8 +5,8 @@ use toml::{Parser}; fn run(toml: &str) { let mut p = Parser::new(toml); let table = p.parse(); - assert!(p.errors.len() > 0); assert!(table.is_none()); + assert!(p.errors.len() > 0); } macro_rules! test( ($name:ident, $toml:expr) => ( diff --git a/tests/valid/hard_example.toml b/tests/valid/hard_example.toml index 6c47b2c..38856c8 100644 --- a/tests/valid/hard_example.toml +++ b/tests/valid/hard_example.toml @@ -13,7 +13,7 @@ test_string = "You'll hate me after this - #" # " Annoying, isn't it? harder_test_string = " And when \"'s are in the string, along with # \"" # "and comments are there too" # Things will get harder - [the.hard.bit#] + [the.hard."bit#"] "what?" = "You don't think some user won't do that?" multi_line_array = [ "]", diff --git a/tests/valid/table-whitespace.toml b/tests/valid/table-whitespace.toml index 798756c..daf881d 100644 --- a/tests/valid/table-whitespace.toml +++ b/tests/valid/table-whitespace.toml @@ -1 +1 @@ -[valid key] +["valid key"] diff --git a/tests/valid/table-with-pound.toml b/tests/valid/table-with-pound.toml index e7b777e..33f2c4f 100644 --- a/tests/valid/table-with-pound.toml +++ b/tests/valid/table-with-pound.toml @@ -1,2 +1,2 @@ -[key#group] +["key#group"] answer = 42 -- cgit v1.2.3