use of net.kyori.adventure.text.minimessage.tree.Node in project adventure by KyoriPowered.
the class MiniMessageParserTest method testTreeOutput.
@Test
void testTreeOutput() {
final String input = "<red> RED <blue> <name> <click:open_url:https://github.com> good <action> </click>";
final TagResolver resolver = TagResolver.resolver(Placeholder.parsed("name", "you"), Placeholder.component("action", Component.text("click")));
final Node tree = MiniMessage.miniMessage().deserializeToTree(input, resolver);
final String expected = "Node {\n" + " TagNode('red') {\n" + " TextNode(' RED ')\n" + " TagNode('blue') {\n" + " TextNode(' you ')\n" + " TagNode('click', 'open_url', 'https://github.com') {\n" + " TextNode(' good ')\n" + " TagNode('action') {\n" + " }\n" + " TextNode(' ')\n" + " }\n" + " }\n" + " }\n" + "}\n";
assertEquals(expected, tree.toString());
}
Aggregations