use of org.spongepowered.configurate.ConfigurationNode in project SpongeCommon by SpongePowered.
the class DuplicateRemovalVisitorTest method testClearsEqualDoublesInChild.
@Test
void testClearsEqualDoublesInChild() {
final ConfigurationNode parent = BasicConfigurationNode.root();
final ConfigurationNode child = BasicConfigurationNode.root();
parent.node("test").raw(42);
child.node("test").raw(42d);
DuplicateRemovalVisitor.visit(child, parent);
assertTrue(child.empty());
assertNull(child.node("test").raw());
}
use of org.spongepowered.configurate.ConfigurationNode in project SpongeCommon by SpongePowered.
the class DuplicateRemovalVisitorTest method testEmpty.
@Test
void testEmpty() {
final ConfigurationNode parent = BasicConfigurationNode.root();
final ConfigurationNode child = BasicConfigurationNode.root();
DuplicateRemovalVisitor.visit(child, parent);
}
use of org.spongepowered.configurate.ConfigurationNode in project SpongeCommon by SpongePowered.
the class DuplicateRemovalVisitorTest method testClearsMapKeys.
@Test
void testClearsMapKeys() {
final ConfigurationNode parent = BasicConfigurationNode.root(n -> {
n.node("test1").raw("yeet");
n.node("test2").raw("yoink");
});
final ConfigurationNode child = BasicConfigurationNode.root(n -> {
n.node("test1").raw("yeet");
n.node("test2").raw("yikes");
});
DuplicateRemovalVisitor.visit(child, parent);
assertTrue(child.node("test1").virtual());
assertEquals("yikes", child.node("test2").raw());
}
use of org.spongepowered.configurate.ConfigurationNode in project SpongeCommon by SpongePowered.
the class DuplicateRemovalVisitorTest method testClearsEqualDoubles.
@Test
void testClearsEqualDoubles() {
final ConfigurationNode parent = BasicConfigurationNode.root();
final ConfigurationNode child = BasicConfigurationNode.root();
parent.raw(3d);
child.raw(3d);
DuplicateRemovalVisitor.visit(child, parent);
assertEquals(3d, parent.raw());
assertNull(child.raw());
child.raw(3);
DuplicateRemovalVisitor.visit(child, parent);
assertNull(child.raw());
}
Aggregations