Skip to content

Check that lexers produce the same output as the input  #2578

@jeanas

Description

@jeanas

On #2531, I just noticed missing groups in rules using bygroups(), making the lexer lose part of the input. (I've seen it on other PRs too.)

We do have this test in test_basic_api.py:

    assert txt == test_content, "%s lexer roundtrip failed: %r != %r" % \
        (cls.name, test_content, txt)

but it only runs on random input.

Let's at least do that when highlighting the tests in tests/snippets/ and tests/examplefiles/.

Metadata

Metadata

Assignees

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