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