From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.devel Subject: Some testing issues Date: Fri, 07 Jul 2017 23:22:40 +0200 Message-ID: <8737a8j61r.fsf@rosalinde> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1499462606 14630 195.159.176.226 (7 Jul 2017 21:23:26 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 7 Jul 2017 21:23:26 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 07 23:23:22 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dTaia-0003EK-7A for ged-emacs-devel@m.gmane.org; Fri, 07 Jul 2017 23:23:16 +0200 Original-Received: from localhost ([::1]:58845 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dTaif-0004Av-Jr for ged-emacs-devel@m.gmane.org; Fri, 07 Jul 2017 17:23:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39894) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dTai7-0004Ae-IH for emacs-devel@gnu.org; Fri, 07 Jul 2017 17:22:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dTai3-0003XQ-Hz for emacs-devel@gnu.org; Fri, 07 Jul 2017 17:22:47 -0400 Original-Received: from mout.gmx.net ([212.227.17.21]:56749) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dTai3-0003WQ-7K for emacs-devel@gnu.org; Fri, 07 Jul 2017 17:22:43 -0400 Original-Received: from rosalinde ([83.135.29.57]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0LraSn-1dqAUm0YI9-013OvG for ; Fri, 07 Jul 2017 23:22:41 +0200 X-Provags-ID: V03:K0:49XBWc587nDd5XKp2EQaCanUwEg14jFhVxT0/So80ruMpNkeq9L r/hflUB8nIqSxoLztxHFHsfjhnzyin469CnYPYR5FR7aEvKFLrGml5OhRpIxOrkZRaZxEwX 53AnkHq52yvJaYd31p5w4IUXj6pH6GTpZHvzFM/DhBsWnSvC0YrwU0fVesJXCH5T4mgsdok zmoYUAQb6J/OQ0TgmQwow== X-UI-Out-Filterresults: notjunk:1;V01:K0:mXwWPlqwloA=:ROBHQNo+WhimlHOq0u1VSj ebHrkB6gD/59g4+c+cUAFls4BVq0ppPG/6bEWHipGFnlBpw40lbar5AV39cm+SBTX4APlp+PA qBOG4ABXvJHSQmHfdjDiQgMe2/2Y53L7Bm2OBL4ox8mnV7c+MKho21cx/P/l2MG4ftAmy/cDf ywQqM/nWhTe06+FHD949Kt2Pfyr6HgmLtSGwDkvJdyfs/GxnVfICQw9NqBrC6aLvvY+vY8Ape oc8KrrEtOzmpgZkeJ/O7Faf+ajLhlspTmgOW/RUuUGxA6ltqSZTStDDua6pMJrqtYtXyxLL+6 8gtP5dqKv3D2H+038TlgVIxV0o9+FrYnt7sFk8USTnNZM0YhHx+CaJ4PUQqSLohArBDT87tpn 8kVAA66LQ7zrZQxPu4LkLdG/FiaBjvCDyUmeFlPROBz/FNqt0V3GuKuuP0Gy0PARoOrbRmVu4 8Uc8RJDiwmoHE/rDpOkniB/8i+U8TktxgjDv6KZhMmT+VoRyPGUJ4MY/fP3vGjk/LJJ1VQkOF 5IThNucdtx5y6RtTcV/+x/1Koi4XZP6oNtZyadpkLT2KgHII0cp/6yQsrCjJBwXNIe9NhbI+a yIZSFrUw9C+QO+91tBKA64BQ8Ay9ZWQZDkvd195jTR7nlBJy9rVWU5FZidThkGQcrat2n+aBW n29wfBWrMUOh6b19WQubYvSkuqnNcdea19Z8MXtmdlnBdV2hYuEC7sr3Gc9tPwTtc3XByGyoY TywguSWgjBkh6WhsPUDFfk0UAYvPk2lfZg6ymEKeulh0vUzVXQQBy0b09rRp5B3pt80Fp8Bv X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.17.21 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:216290 Archived-At: I installed some new tests for todo-mode.el in master c24748a and there were a few problems that I don't understand; maybe someone here can enlighten me. Several of the tests call the function todo-toggle-view-done-items, which contains this code: (if (not (pos-visible-in-window-p shown)) (recenter) (`shown' stores the position of the first done item in the category, if it is shown.) When using todo-mode and also when stepping through the function with Edebug, it works as expected. But when running the tests, sometimes -- but not always -- it fails with the error "`recenter'ing a window that does not display current-buffer." In those cases, the test failure is prevented by evaluating the following sexp immediately before calling todo-toggle-view-done-items: (set-window-buffer nil (current-buffer)) When using todo-mode this is not necessary, because the selected window always contains the current buffer when the function is called, but apparently when running the tests, this isn't always the case, although according to Edebug it is, AFAICT. And again, the failure only happens in some cases, though in those, it is reliably reproducible. In addition, in at least one case, when I rerun the test immediately after it fails, then it succeeds. And lastly, in one case, the test succeeds without the set-window-buffer call when run interactively, but fails without it when run in batch mode from the shell. Any idea what's going on here? (If anyone wants to take a closer look, comments in the test file point out the problematic cases.) A second problem concerns trying to reference a message in a test. The function todo-toggle-view-done-items outputs a message if the category contains no done items, and the test captures this by calling current-message immediately after todo-toggle-view-done-items. This works when running the test interactively, but in a batch run, current-message is nil (though the message is output in the shell). Why? (I avoid the failure in batch mode by testing a different but effectively equivalent condition.) Finally, one of the tests involves a display overlay that hides the item header, which as a consequence, when using todo-mode, prevented the cursor from appearing where the code put point, resulting in a display bug. I fixed this (in master 264dd81) by moving point to the first visible position after the overlay. But when running the test, the overlay evidently does not inhibit point, but since the test, following the bugfix code in todo-mode.el, assumes it does, it fails. It seems that the test environment does not reflect the same display mechanisms that using the code does. I haven't found a solution or workaround for this, so the test is currently marked ":expected-result :failed". I hope someone can come up with a better alternative. I'd be grateful for any suggestions or advice. Steve Berman