Search in sources :

Example 1 with ArgumentQueue

use of net.kyori.adventure.text.minimessage.tag.resolver.ArgumentQueue in project adventure by KyoriPowered.

the class MiniMessageParserTest method invalidPreprocessTagNames.

@Test
void invalidPreprocessTagNames() {
    final String input = "Some<##>of<>these<tag>are<3 >tags";
    final Component expected = Component.text("Some<##>of<>these(meow)are<3 >tags");
    final TagResolver alwaysMatchingResolver = new TagResolver() {

        @Override
        public Tag resolve(@NotNull final String name, @NotNull final ArgumentQueue arguments, @NotNull final Context ctx) throws ParsingException {
            return Tag.preProcessParsed("(meow)");
        }

        @Override
        public boolean has(@NotNull final String name) {
            return true;
        }
    };
    assertParsedEquals(expected, input, alwaysMatchingResolver);
}
Also used : TagResolver(net.kyori.adventure.text.minimessage.tag.resolver.TagResolver) Component(net.kyori.adventure.text.Component) TextComponent(net.kyori.adventure.text.TextComponent) NotNull(org.jetbrains.annotations.NotNull) ArgumentQueue(net.kyori.adventure.text.minimessage.tag.resolver.ArgumentQueue) Test(org.junit.jupiter.api.Test)

Aggregations

Component (net.kyori.adventure.text.Component)1 TextComponent (net.kyori.adventure.text.TextComponent)1 ArgumentQueue (net.kyori.adventure.text.minimessage.tag.resolver.ArgumentQueue)1 TagResolver (net.kyori.adventure.text.minimessage.tag.resolver.TagResolver)1 NotNull (org.jetbrains.annotations.NotNull)1 Test (org.junit.jupiter.api.Test)1