emacs-devel
[Top][All Lists]
Advanced

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

Re: Testing fontification, indentation, and buffer manipulation


From: Yuri Khan
Subject: Re: Testing fontification, indentation, and buffer manipulation
Date: Wed, 16 Jan 2019 01:45:07 +0700

On Tue, Jan 15, 2019 at 10:52 PM Daniele Nicolodi <address@hidden> wrote:

> I am hacking on beancount-mode (a mode to edit Beancount ledger files)
> and I would like to write some automated tests to check the
> functionality of the minor mode.  I found ERT, but it seems that it does
> not offer any facility to easily test fontification, indentation, or
> buffer manipulation in general.
>
> Is there any facility that would help in writing such tests?

You might want to look at ledger-mode tests. Its approach to
fontification testing is:

* Create a temporary buffer.
* Put test text into it.
* Harvest it back with fontification properties into a data structure.
* Test that this structure is equal to the golden output.

https://github.com/ledger/ledger-mode/blob/master/test/test-helper.el#L149
https://github.com/ledger/ledger-mode/blob/master/test/fontify-test.el



reply via email to

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