unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
To: Paul Pogonyshev <pogonyshev@gmx.net>
Cc: rms@gnu.org, emacs-devel@gnu.org
Subject: Re: regression in key handling
Date: Thu, 22 Nov 2007 22:44:15 +0100	[thread overview]
Message-ID: <4745F82F.2040901@gmail.com> (raw)
In-Reply-To: <200711222329.23935.pogonyshev@gmx.net>

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.

  reply	other threads:[~2007-11-22 21:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-20 20:42 regression in key handling Paul Pogonyshev
2007-11-22  2:26 ` Richard Stallman
2007-11-22 21:29   ` Paul Pogonyshev
2007-11-22 21:44     ` Lennart Borgman (gmail) [this message]
2007-11-26  5:34 ` Richard Stallman
2007-11-26 21:18   ` Paul Pogonyshev
2007-11-27  5:30     ` Richard Stallman
2007-11-27 15:40       ` Stefan Monnier
2007-11-28  4:49       ` Stefan Monnier
2007-11-29  1:03         ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4745F82F.2040901@gmail.com \
    --to=lennart.borgman@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=pogonyshev@gmx.net \
    --cc=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).