[Top][All Lists]

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

Re: automated indent tests

From: Dmitry Gutov
Subject: Re: automated indent tests
Date: Sun, 29 Nov 2015 20:00:45 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:42.0) Gecko/20100101 Thunderbird/42.0

On 11/29/2015 07:50 PM, Stephen Leake wrote:

For tests where auto-mode-alists fails, we could require a file local
variable to set the mode. That would make it easier to debug the test
interactively as well.

I prefer them in the files as file local variables; that makes it easier
to debug the test interactively.

Unless you want to use one unindented file, indent it with several
different indent options, and compare each result to a different

In some cases, the final indentation can depend on the starting point.
Certainly that will be true for languages where the syntax relies on the
indentation (Python etc).

So maybe allowing for both forms of test would be best.

All good ideas.

For my ada-mode indentation tests, I store only the known-good file in
the resource directory, autmatically de-indent every line by two spaces,
then reindent and compare to the original. That has been sufficient so

On top-level, there's nowhere to de-indent. So maybe add two spaces of indentation instead?

And also, most indentation functions don't change the indentation inside multiline string literals. So that would have to be taken care of somehow, maybe with a "this is a string" annotation comments.

reply via email to

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