From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: automated indent tests Date: Sun, 29 Nov 2015 20:00:45 +0200 Message-ID: <565B3D4D.6040404@yandex.ru> References: <20151126211432.7647.1395@vcs.savannah.gnu.org> <5659F8CC.2070106@yandex.ru> <87d1uukk29.fsf@russet.org.uk> <565A0931.8010502@yandex.ru> <874mg5lt2u.fsf@russet.org.uk> <565A7C13.6080807@yandex.ru> <86oaecvgn4.fsf_-_@stephe-leake.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1448820056 7446 80.91.229.3 (29 Nov 2015 18:00:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 29 Nov 2015 18:00:56 +0000 (UTC) Cc: emacs-devel@gnu.org, Phillip Lord To: Stephen Leake Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 29 19:00:53 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1a36HM-0004qP-Fs for ged-emacs-devel@m.gmane.org; Sun, 29 Nov 2015 19:00:52 +0100 Original-Received: from localhost ([::1]:37228 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a36HQ-0007XS-Dj for ged-emacs-devel@m.gmane.org; Sun, 29 Nov 2015 13:00:56 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53974) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a36HM-0007XF-UR for emacs-devel@gnu.org; Sun, 29 Nov 2015 13:00:53 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a36HI-0000FO-Pn for emacs-devel@gnu.org; Sun, 29 Nov 2015 13:00:52 -0500 Original-Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]:33567) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a36HI-0000Eu-II for emacs-devel@gnu.org; Sun, 29 Nov 2015 13:00:48 -0500 Original-Received: by wmec201 with SMTP id c201so126333140wme.0 for ; Sun, 29 Nov 2015 10:00:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=M6dt3N0m2iGJFeF0tbs4SktlAxeoQu3tdhcAYz0DpHw=; b=vXKfZxP9EFVD7StVkLZuz3p2PkT/3ZvgL5NNEfBOCp50PJK4wvl3ZbZSpR/w49oTEb XwsVSAn7zWME3ta5162xZ0NzASBGPy01Fskx2EZ35Z+jQhRGB7w9IK4SF9vjbEm6HdD2 vGy4Bnhlt8whHnDsOnvW3c6GgeR8NIBRxsR1knDMG19xEtMWkun1v4lErvGCh86kPmr3 TIs1yJcC+qvG4k7rU03KC6CzOqWROlMqs6lyxsRQtd3w4QqzF+MlCIG79c3F0x8BqzHP 754EWU+G5kaX9/Q6x7CpzOYm+rbpufjKF17WmyRFFMgyFJYoADSxyHcc4jgRjJXlGY+4 fGDQ== X-Received: by 10.28.53.130 with SMTP id c124mr22160283wma.16.1448820047625; Sun, 29 Nov 2015 10:00:47 -0800 (PST) Original-Received: from [192.168.1.2] ([185.105.175.24]) by smtp.googlemail.com with ESMTPSA id lf10sm29611688wjb.23.2015.11.29.10.00.46 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 29 Nov 2015 10:00:46 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:42.0) Gecko/20100101 Thunderbird/42.0 In-Reply-To: <86oaecvgn4.fsf_-_@stephe-leake.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c09::232 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:195557 Archived-At: 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 > far. 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.