From e756f56b62053a34aa26a00e28dbe4ce29cd9125 Mon Sep 17 00:00:00 2001 From: Huon Wilson Date: Fri, 18 Jul 2014 20:19:21 +1000 Subject: Disambiguate "" empty strings from multiline strings properly. Previously `""` would go into multiline mode and thus *require* a following ". --- src/test/valid.rs | 3 +++ src/test/valid/string-empty.json | 6 ++++++ src/test/valid/string-empty.toml | 1 + 3 files changed, 10 insertions(+) create mode 100644 src/test/valid/string-empty.json create mode 100644 src/test/valid/string-empty.toml (limited to 'src/test') diff --git a/src/test/valid.rs b/src/test/valid.rs index 9a812d5..1bcfeb2 100644 --- a/src/test/valid.rs +++ b/src/test/valid.rs @@ -122,6 +122,9 @@ test!(long_float, test!(long_integer, include_str!("valid/long-integer.toml"), include_str!("valid/long-integer.json")) +test!(string_empty, + include_str!("valid/string-empty.toml"), + include_str!("valid/string-empty.json")) test!(string_escapes, include_str!("valid/string-escapes.toml"), include_str!("valid/string-escapes.json")) diff --git a/src/test/valid/string-empty.json b/src/test/valid/string-empty.json new file mode 100644 index 0000000..6c26d69 --- /dev/null +++ b/src/test/valid/string-empty.json @@ -0,0 +1,6 @@ +{ + "answer": { + "type": "string", + "value": "" + } +} diff --git a/src/test/valid/string-empty.toml b/src/test/valid/string-empty.toml new file mode 100644 index 0000000..e37e681 --- /dev/null +++ b/src/test/valid/string-empty.toml @@ -0,0 +1 @@ +answer = "" -- cgit v1.2.3