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: Daniele Nicolodi
Subject: Re: Testing fontification, indentation, and buffer manipulation
Date: Sat, 19 Jan 2019 08:07:13 -0700
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.4.0

On 15/01/2019 11:45, Yuri Khan wrote:
> 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

Thanks Yuri, this is very helpful.

Cheers,
Dan





reply via email to

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