|
|
|
@ -707,8 +707,8 @@ public class ConfigTest {
|
|
|
|
|
assertEquals("0", c.getString("a", null, "x")); |
|
|
|
|
assertEquals(0, c.getInt("a", null, "x", 1)); |
|
|
|
|
|
|
|
|
|
assertEquals("", c.getString("a", null, "y")); |
|
|
|
|
assertArrayEquals(new String[]{""}, c.getStringList("a", null, "y")); |
|
|
|
|
assertNull(c.getString("a", null, "y")); |
|
|
|
|
assertArrayEquals(new String[]{null}, c.getStringList("a", null, "y")); |
|
|
|
|
try { |
|
|
|
|
c.getInt("a", null, "y", 1); |
|
|
|
|
} catch (IllegalArgumentException e) { |
|
|
|
@ -730,9 +730,13 @@ public class ConfigTest {
|
|
|
|
|
public void testEmptyValueAtEof() throws Exception { |
|
|
|
|
String text = "[a]\nx ="; |
|
|
|
|
Config c = parse(text); |
|
|
|
|
assertEquals("", c.getString("a", null, "x")); |
|
|
|
|
assertNull(c.getString("a", null, "x")); |
|
|
|
|
assertArrayEquals(new String[]{null}, |
|
|
|
|
c.getStringList("a", null, "x")); |
|
|
|
|
c = parse(text + "\n"); |
|
|
|
|
assertEquals("", c.getString("a", null, "x")); |
|
|
|
|
assertNull(c.getString("a", null, "x")); |
|
|
|
|
assertArrayEquals(new String[]{null}, |
|
|
|
|
c.getStringList("a", null, "x")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static void assertReadLong(long exp) throws ConfigInvalidException { |
|
|
|
|