From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Lennart Borgman (gmail)" Newsgroups: gmane.emacs.devel Subject: Re: regression in key handling Date: Thu, 22 Nov 2007 22:44:15 +0100 Message-ID: <4745F82F.2040901@gmail.com> References: <200711202242.03838.pogonyshev@gmx.net> <200711222329.23935.pogonyshev@gmx.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1195767892 10207 80.91.229.12 (22 Nov 2007 21:44:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 22 Nov 2007 21:44:52 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org To: Paul Pogonyshev Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 22 22:44:59 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IvJr0-0006ea-RO for ged-emacs-devel@m.gmane.org; Thu, 22 Nov 2007 22:44:59 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IvJqm-0006lU-Jt for ged-emacs-devel@m.gmane.org; Thu, 22 Nov 2007 16:44:44 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IvJqi-0006k3-4L for emacs-devel@gnu.org; Thu, 22 Nov 2007 16:44:40 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IvJqh-0006jE-6X for emacs-devel@gnu.org; Thu, 22 Nov 2007 16:44:39 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IvJqg-0006j6-Hc for emacs-devel@gnu.org; Thu, 22 Nov 2007 16:44:38 -0500 Original-Received: from ch-smtp01.sth.basefarm.net ([80.76.149.212]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IvJqZ-0002dV-Jx; Thu, 22 Nov 2007 16:44:32 -0500 Original-Received: from c83-254-148-228.bredband.comhem.se ([83.254.148.228]:63065 helo=[127.0.0.1]) by ch-smtp01.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1IvJqX-00041v-3c; Thu, 22 Nov 2007 22:44:29 +0100 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 In-Reply-To: <200711222329.23935.pogonyshev@gmx.net> X-Antivirus: avast! (VPS 071122-0, 2007-11-22), Outbound message X-Antivirus-Status: Clean X-Originating-IP: 83.254.148.228 X-Scan-Result: No virus found in message 1IvJqX-00041v-3c. X-Scan-Signature: ch-smtp01.sth.basefarm.net 1IvJqX-00041v-3c 3bf92b332ed57798ab614aabe91e9d8d X-detected-kernel: by monty-python.gnu.org: Linux 2.6? (barebone, rare!) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:83900 Archived-At: Paul Pogonyshev wrote: > Richard Stallman wrote: >> I really think Emacs would benifit from some automated system >> of regression testing, like unit tests or sth. like that. >> >> It isn't trivial do that for keyboard input. >> Would you like to work on that? > > I'm not following Emacs development closely, but I noticed some > discussion about automated test framework recently. Didn't see > what it came too, though. > > But given that such a framework is in place, I could write > something like this test: > > ;; Test that S-backspace deletes exactly one char. > (with-temp-buffer > (insert "XY") > ; Dispatch S-backspace key somehow... > (assert (= (buffer-size) 1))) > > The problem is I don't know how to emulate a key press. Ideally, > it should work exactly the same way as if user pressed the key. > > So, we'd need 1) a testing framework (I assume someone wrote > something already, given the discussion) and 2) a way to emulate > key presses. Is there a way to do point 2) in Emacs already? You can use uread-command-events to simulate events, see for example isearch-unread.