mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-16 04:33:56 -07:00
Configuration methods .getX (int/double/etc) now try to cast existing values where possible. This fixes BUKKIT-290
By: Nathan Adams <dinnerbone@dinnerbone.com>
This commit is contained in:
@@ -315,9 +315,21 @@ public abstract class ConfigurationSectionTest {
|
||||
ConfigurationSection section = getConfigurationSection();
|
||||
String key = "exists";
|
||||
double value = Double.MAX_VALUE;
|
||||
|
||||
|
||||
section.set(key, value);
|
||||
|
||||
|
||||
assertEquals(value, section.getDouble(key), 1);
|
||||
assertNull(section.getString("doesntExist"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetDoubleFromInt() {
|
||||
ConfigurationSection section = getConfigurationSection();
|
||||
String key = "exists";
|
||||
double value = 123;
|
||||
|
||||
section.set(key, (int)value);
|
||||
|
||||
assertEquals(value, section.getDouble(key), 1);
|
||||
assertNull(section.getString("doesntExist"));
|
||||
}
|
||||
|
Reference in New Issue
Block a user