From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Daniele Nicolodi Newsgroups: gmane.emacs.devel Subject: Re: Testing fontification, indentation, and buffer manipulation Date: Sat, 19 Jan 2019 08:07:13 -0700 Message-ID: <2d777e7b-28d9-36a5-073d-b439fca9706a@grinta.net> References: <7803c5de-e139-01ed-e9e3-98abb875782b@grinta.net> NNTP-Posting-Host: ciao.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Trace: ciao.gmane.org 1547910463 259884 195.159.176.228 (19 Jan 2019 15:07:43 GMT) X-Complaints-To: usenet@ciao.gmane.org NNTP-Posting-Date: Sat, 19 Jan 2019 15:07:43 +0000 (UTC) User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jan 19 16:07:40 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1gksDk-0015Yr-K2 for ged-emacs-devel@m.gmane.org; Sat, 19 Jan 2019 16:07:40 +0100 Original-Received: from localhost ([127.0.0.1]:56796 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gksDt-0007NH-KO for ged-emacs-devel@m.gmane.org; Sat, 19 Jan 2019 10:07:49 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:49106) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gksDl-0007Ly-8d for emacs-devel@gnu.org; Sat, 19 Jan 2019 10:07:42 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gksDk-00042P-E6 for emacs-devel@gnu.org; Sat, 19 Jan 2019 10:07:41 -0500 Original-Received: from zed.grinta.net ([109.74.203.128]:47462) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gksDd-0003s7-FD for emacs-devel@gnu.org; Sat, 19 Jan 2019 10:07:37 -0500 Original-Received: from black.hsd1.co.comcast.net (c-98-245-163-4.hsd1.co.comcast.net [98.245.163.4]) (Authenticated sender: daniele) by zed.grinta.net (Postfix) with ESMTPSA id AF44AE3C0B for ; Sat, 19 Jan 2019 15:07:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=grinta.net; s=mail; t=1547910437; bh=C0Tit/uUIEciEUdd0lJPb1iCa/m9R77DA6R4hw4dNXU=; h=Subject:To:References:From:Date:In-Reply-To:From; b=U9fc5F8WxvsWZrW7FIlWVhbu7MEFwXq5opesWy7u+rs5QwlqS7RsuRkXTnrYRjcIn AvTkdy3n++zo+ID4IMySmQWlo8D5u4vWXGuQnidSkar8DpaGubGubv7Nz6NmMHVDyg aXpBHr5USx/0skJO8zw9t8IUfA7gulDGRpU+yw9E= Openpgp: preference=signencrypt In-Reply-To: Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 109.74.203.128 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:232490 Archived-At: On 15/01/2019 11:45, Yuri Khan wrote: > On Tue, Jan 15, 2019 at 10:52 PM 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? > > 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