From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.devel Subject: Re: Question about test failure on Hydra Date: Tue, 01 Aug 2017 13:39:50 +0900 Message-ID: <87efsvkijt.fsf@calancha-pc> References: <87efsxexf5.fsf@rosalinde> <83r2wx29w9.fsf@gnu.org> <8760e9eksb.fsf@rosalinde> <83ini91e2o.fsf@gnu.org> <87tw1t7yk5.fsf@rosalinde> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1501562439 2849 195.159.176.226 (1 Aug 2017 04:40:39 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 1 Aug 2017 04:40:39 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Stephen Berman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 01 06:40:33 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 1dcOyr-0000Bx-Kw for ged-emacs-devel@m.gmane.org; Tue, 01 Aug 2017 06:40:29 +0200 Original-Received: from localhost ([::1]:34395 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcOyx-0001j5-F5 for ged-emacs-devel@m.gmane.org; Tue, 01 Aug 2017 00:40:35 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37335) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcOyN-0001ik-EO for emacs-devel@gnu.org; Tue, 01 Aug 2017 00:40:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dcOyK-00074h-AB for emacs-devel@gnu.org; Tue, 01 Aug 2017 00:39:59 -0400 Original-Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]:35363) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dcOyK-00074F-4L; Tue, 01 Aug 2017 00:39:56 -0400 Original-Received: by mail-pf0-x244.google.com with SMTP id q85so699065pfq.2; Mon, 31 Jul 2017 21:39:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=8c47hX611/KnAdy4DPJcqpZxFI4TkBIf3aKJWDZjqgU=; b=B8ZPy597baTDkxo7qsFMiJ1ncyJeLvv/QJh2w65JFi70NS4uf/leeyPCkFIz+uGJg2 +9Bn5cdpV6KsO8ZkkhnecRHuyqQf0n48/3qSjdz/yhykEtU5qmlSPzf0y09UIma4eEcL o53ew3sj5APr5KOwcijplVsAKxLb0/36KP3rGOvuZaCV1vdN33jz7hNzkzVW1iBYbRKV 0sixSyOtqGbVCV6axieMpBYn4WmpMfLvKkv2npC2fofFTc/zAfCMPVpyJ5uomHOWCZSI Vhu3WVcVal/anm4W8hImwcHVIoBNPRaYSGqKDdPRxzSnMycxT5ZYru1gCFm73bx9s4Cm 6h0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=8c47hX611/KnAdy4DPJcqpZxFI4TkBIf3aKJWDZjqgU=; b=WvqKn+EXX+02aczVptG9d2pLNBE7rv3AXvVMG8C+/oveqJijA0dCF8N8FMXBzA5BkL cbkQ6YnM63bLM1RoI/9PKpdKovk1aAg40B9U/UQ/zciSa1RbonQJzl+vxq3E5KQnQVuq 76RvBa3fmgyuK/MlPoQ/yF0SUDjHAdWnMEBpZVSGnKlB7Gq6mTLlxVTuUUS9oEK6bvDu c1meQ5yJNH3/RzaIn+8EjfsYQDFV53haH9x/Jz0YILVVz50Mw1QtFx00MzFKfQ/vPJpm VS+YxQMlxNl/+mz+EWBx9++byy7ao8Ke4ySkv7EdFeF/JKaF9XWZ7cXFL3HhqcTsWTgm 5MUg== X-Gm-Message-State: AIVw113c5s/RHGUmOdm0gGSH0MCc3589rDkGO/CzXAV17VRBlIEY/Tow /MAQulDEnfeuSW/g X-Received: by 10.84.164.165 with SMTP id w34mr19315073pla.436.1501562394922; Mon, 31 Jul 2017 21:39:54 -0700 (PDT) Original-Received: from calancha-pc (170.224.128.101.dy.bbexcite.jp. [101.128.224.170]) by smtp.gmail.com with ESMTPSA id a125sm45639045pgc.37.2017.07.31.21.39.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 31 Jul 2017 21:39:54 -0700 (PDT) In-Reply-To: <87tw1t7yk5.fsf@rosalinde> (Stephen Berman's message of "Mon, 31 Jul 2017 11:20:10 +0200") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::244 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:217192 Archived-At: Stephen Berman writes: > On Mon, 31 Jul 2017 06:26:55 +0300 Eli Zaretskii wrote: > > (dired test-dir) reverts an existing Dired buffer, because of setting > dired-auto-revert-buffer to t. (When I step through the code, it is > after reverting that point moves to the subdirectory line, which the > should make "sanity check" true (and does, both when I step through the > code and just run the test in any way). When I comment out the > dired-auto-revert-buffer line, then point stays at point-min, which > makes the sanity check fail (dired-file-name-at-point returns nil), When i comment out i see the point in point-max, and the test fails same as you but: (dired-file-name-at-point returns nil) > though not in the way Hydra reports (it shows point being on the ".." > entry).) If somehow, we have in such Dired buffer the point at ".." _before_ call `dired-revert', then _after_ revert the point is preserved: (let ((test-dir (make-temp-file "test-dir-" t)) (dired-auto-revert-buffer t) buffers buf) (with-current-buffer (setq buf (find-file-noselect test-dir)) (make-directory "test-subdir")) (with-current-buffer buf (forward-line -1)) (push (dired test-dir) buffers) (with-current-buffer buf (dired-get-filename t t))) => ".." ;; Return "test-subdir" when comment out line: (with-current-buffer buf (forward-line -1)) We can insert additional `should' calls in the failing tests and wait until next hydra failoure. (Following just add more should forms into `dired-test-bug27243-01'; we might do the same in `dired-test-bug27243-02' and `dired-test-bug27243-03'). --8<-----------------------------cut here---------------start------------->8--- commit 5483d883f753b5a2e0b45bff2a659b8d27a017a9 Author: Tino Calancha Date: Tue Aug 1 13:18:28 2017 +0900 * test/lisp/dired-tests.el (dired-test-bug27243-01): Add more should forms diff --git a/test/lisp/dired-tests.el b/test/lisp/dired-tests.el index d6fe839708..0ee4e13783 100644 --- a/test/lisp/dired-tests.el +++ b/test/lisp/dired-tests.el @@ -122,11 +122,18 @@ (ert-deftest dired-test-bug27243-01 () "Test for https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27243#5 ." - (let ((test-dir (make-temp-file "test-dir-" t)) + (let ((test-dir (file-name-as-directory (make-temp-file "test-dir-" t))) (dired-auto-revert-buffer t) buffers) + (should-not (dired-buffers-for-dir test-dir)) (with-current-buffer (find-file-noselect test-dir) (make-directory "test-subdir")) + ;; Point must be at end-of-buffer. + (with-current-buffer (car (dired-buffers-for-dir test-dir)) + (should (eobp))) (push (dired test-dir) buffers) + ;; Previous dired call shouldn't create a new buffer: must visit the one + ;; created by `find-file-noselect' above. + (should (eq 1 (length (dired-buffers-for-dir test-dir)))) (unwind-protect (let ((buf (current-buffer)) (pt1 (point)) @@ -135,11 +142,10 @@ (write-region "Test" nil test-file nil 'silent nil 'excl) ;; Sanity check: point should now be on the subdirectory. (should (equal (dired-file-name-at-point) - (concat (file-name-as-directory test-dir) - (file-name-as-directory "test-subdir")))) + (concat test-dir (file-name-as-directory "test-subdir")))) (push (dired-find-file) buffers) (let ((pt2 (point))) ; Point is on test-file. - (switch-to-buffer buf) + (pop-to-buffer-same-window buf) ;; Sanity check: point should now be back on the subdirectory. (should (eq (point) pt1)) (push (dired-find-file) buffers) --8<-----------------------------cut here---------------end--------------->8--- In GNU Emacs 26.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.11) of 2017-07-31 Repository revision: 3a8d0cc825635e07da2a90c4ac987b476fc9b05d