emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Testing strategy for Tree-sitter modes


From: Jostein Kjønigsen
Subject: Re: [PATCH] Testing strategy for Tree-sitter modes
Date: Sun, 8 Jan 2023 22:14:40 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1

On 08.01.2023 15:23, Daniel Martín wrote:
I think the development of Tree-sitter modes would benefit from having a
regression test suite that ensures that bug fixes for specific cases
don't regress in the future.

As a start, I've attached to this mail some ERT-based tests for the
indentation feature of c-ts-mode.  I've used the convenient feature of
"erts" files to create the tests, which I think make them readable and
maintainable.

The tests are skipped if the Emacs build does not have Tree-sitter
enabled, or if the corresponding grammar is not installed.  Perhaps it
would be a good idea to install these Tree-sitter dependencies in the
container images used for EMBA (https://emba.gnu.org/emacs), so that
we're able to run Tree-sitter tests in continuous integration, and even
play with different versions of Tree-sitter or the Tree-sitter grammars
to detect incompatibilities.  I'll leave this decision to the people in
charge of EMBA.

Thanks.

I fully support the addition of the possibility to have a test-suite run on CI.

When we ported csharp-mode and typescript-mode from ELPA to new ts-based major modes in Emacs-core, I always felt like this was the one thing I really wished we'd have here as well.

If this can be added easily, it would make it much easier (and safer!) to make changes to tree-sitter grammars in major-modes with complex grammer, and where it's not always obvious what rule covers what use-case(s).

--
Jostein




reply via email to

[Prev in Thread] Current Thread [Next in Thread]