Skip to content

nonOf Parser Bug? #49

@webITSol

Description

@webITSol
class NoneOfTest {
    @Test
    void testNoneOfTrim() {
        Parser noneOfParser = CharacterParser.noneOf("xyz").plus().flatten();
        Parser noneOfTrimParser = noneOfParser.trim();

        assertEquals("abc", noneOfParser.parse("abc").get());
        assertEquals(" abc ", noneOfParser.parse(" abc ").get());
        assertEquals("abc", noneOfTrimParser.parse("abc").get());
        assertEquals("abc", noneOfTrimParser.parse(" abc ").get()); // fails
    }
}

Last assert fails. Is that intended?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions