tests issue #2805 - overgeneralised recognition of file as keyword in csharp lexer by jofish920 · Pull Request #2806 · pygments/pygments

added 2 commits

November 9, 2024 16:40
Currently the added tests all show up as expected fails when running
pytest; each test has a parameter that can be switched to `True`
when a fix is implemented.

Josef Meyer added 2 commits

November 10, 2024 00:23
This fixes the cases where 'file' is incorrectly tagged as a keyword.
The tests for those cases have been switched from `pytest.xfail` to normal.
Adds tests for all cases covered by the new regex.
Reformats the tests to make them more compact.
This change replaces the test written using pytest with the file
`tests/snippets/csharp/test_file_keyword.txt`.

The change removes the ability to toggle between `xfail` and real
failure for cases that are not expected to pass, but brings testing
in line with the rest of the codebase.  The tests involving `await`
have been removed - which is fitting, as it was not the same issue.

jofish920 added a commit to jofish920/pygments that referenced this pull request

Nov 13, 2024
…yword in csharp lexer (pygments#2806)

* test: adds tests showing problems with 'file'

Currently the added tests all show up as expected fails when running
pytest; each test has a parameter that can be switched to `True`
when a fix is implemented.

* chore: removed extraneous material from test

* fix: fixes test cases where 'file' isn't a keyword

This fixes the cases where 'file' is incorrectly tagged as a keyword.
The tests for those cases have been switched from `pytest.xfail` to normal.

* test: adds test cases covering file as keyword

Adds tests for all cases covered by the new regex.
Reformats the tests to make them more compact.

* fix: replaces pytest for issue pygments#2806 with snippet

This change replaces the test written using pytest with the file
`tests/snippets/csharp/test_file_keyword.txt`.

The change removes the ability to toggle between `xfail` and real
failure for cases that are not expected to pass, but brings testing
in line with the rest of the codebase.  The tests involving `await`
have been removed - which is fitting, as it was not the same issue.

---------

Co-authored-by: Josef Meyer <20089460@tafe.wa.edu.au>