emacs-diffs
[Top][All Lists]
Advanced

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

Re: [Emacs-diffs] /srv/bzr/emacs/trunk r112522: * lisp/progmodes/ruby-mo


From: Dmitry Gutov
Subject: Re: [Emacs-diffs] /srv/bzr/emacs/trunk r112522: * lisp/progmodes/ruby-mode.el: First cut at SMIE support.
Date: Thu, 23 May 2013 03:25:58 +0400
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6

On 23.05.2013 3:01, Stefan Monnier wrote:
True.  Tho most bug reports about regexp literals do include such
unpaired quotes or parens (since that's the case where the lack of
special treatment really hurts), so I'd expect most "test cases" in the
test/indent directory to include such entries.

Can't disagree with that.

We could potentially test it by calling htmlfontify-buffer.
So, there would be a reference html file everyone would have to update after
making a change in indent/ruby.rb?

Probably.  Tho you could potentially change the test so it first
un-htmlizes the file, then runs font-lock, then htmlfontify, in which
case the file stored in test/indent would be the html version.

I guess that sounds more like enriched-mode than htmlfontify-buffer.

Sounds interesting. That would take some work to implement, I suppose.

ruby-mode also has customization variables that change indentation behavior
(at least one, for now, and we should add more). How do you propose to
test that?
Indeed, that's a widespread limitation with the current system.
I suppose we could set the variables via file-local vars mechanism, but
that'll require us to have multiple files, one per combination of variables.

Yes.

Or introduce some new kind of preprocessing, say, treat the same kind of
comment in the middle of the file as an indication to stop, change the
values, and indent the part of the file below with new values applied.

We could, but then we'd lose the easy way to test&debug interactively by
simply visiting the file.  ERT isn't much worse in that case (and the
two aren't mutually exclusive: use test/indent the general indentation
rules, and use ERT rules to check how indentation obeys the various
indentation variables).

Having ruby.rb indented according to the default settings and test any alternative settings via ERT sounds fine, except we now have two indentation engines, after all, and ideally we'd like to test all indentation cases in both of them, automatically.

How about having one big test in ruby-mode-tests.el that would load test/indent/ruby.rb and do the reindent-and-compare thing that is currently performed via make?

For bonus points, we could delineate test.rb with comments in some special way, so that we can have multiple tests "coexist" in it (by being able to refer and test just one part).



reply via email to

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