From 14ec051e22fa5420c7595b5f66128cbdcb2156de Mon Sep 17 00:00:00 2001 From: Paul Koerbitz Date: Mon, 30 Jun 2014 18:29:04 +0200 Subject: [PATCH] Add 'EmptyStringTest.java' which shows problem with empty strings --- .../com/moandjiezana/toml/EmptyStringTest.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/test/java/com/moandjiezana/toml/EmptyStringTest.java diff --git a/src/test/java/com/moandjiezana/toml/EmptyStringTest.java b/src/test/java/com/moandjiezana/toml/EmptyStringTest.java new file mode 100644 index 0000000..83bd823 --- /dev/null +++ b/src/test/java/com/moandjiezana/toml/EmptyStringTest.java @@ -0,0 +1,15 @@ +package com.moandjiezana.toml; + +import static org.junit.Assert.assertEquals; +import org.junit.Test; + +import java.io.File; + +public class EmptyStringTest { + @Test + public void should_parse_multiple_sections() { + Toml toml = new Toml().parse("str1 = \"\"\nstr2 = \"Hello, world!\""); + assertEquals("", toml.getString("str1")); + assertEquals("Hello, world!", toml.getString("str2")); + } +}