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: Helmut Eller
Subject: Re: Testing fontification, indentation, and buffer manipulation
Date: Wed, 16 Jan 2019 08:58:18 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

On Tue, Jan 15 2019, Daniele Nicolodi 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?

Something that I found useful was using somewhat exotic characters to
mark positions.  E.g.

  (forth-assert-face ": →frob ;" font-lock-function-name-face)

tests that the face after the → is font-lock-function-name-face.

Or

  (forth-assert-forward-sexp " ¹if drop exit else 1+ then² bar ")

tests that if forward-sexp is called at the position marked with ¹ it
will move to ².

Helmut




reply via email to

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