From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#30327: 27.0.50; Failures in files-tests.el on macOS Date: Sat, 03 Feb 2018 11:29:29 -0500 Message-ID: <87wozuf34m.fsf@users.sourceforge.net> References: <87inbfxd5o.fsf@gmx.de> <20180202230441.GA9047@breton.holly.idiocy.org> <87zi4qfwum.fsf@users.sourceforge.net> <20180203161311.GA17938@breton.holly.idiocy.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1517675320 9522 195.159.176.226 (3 Feb 2018 16:28:40 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 3 Feb 2018 16:28:40 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) Cc: Philipp Stephani , Michael Albinus , 30327@debbugs.gnu.org To: Alan Third Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Feb 03 17:28:35 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1ei0ff-0000el-Qe for geb-bug-gnu-emacs@m.gmane.org; Sat, 03 Feb 2018 17:28:08 +0100 Original-Received: from localhost ([::1]:48794 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ei0hg-0004zr-W2 for geb-bug-gnu-emacs@m.gmane.org; Sat, 03 Feb 2018 11:30:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60026) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ei0ha-0004zB-UU for bug-gnu-emacs@gnu.org; Sat, 03 Feb 2018 11:30:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ei0hX-00044p-Ku for bug-gnu-emacs@gnu.org; Sat, 03 Feb 2018 11:30:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:47931) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ei0hX-00044i-E3 for bug-gnu-emacs@gnu.org; Sat, 03 Feb 2018 11:30:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ei0hW-0005v0-U3 for bug-gnu-emacs@gnu.org; Sat, 03 Feb 2018 11:30:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 03 Feb 2018 16:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30327 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 30327-submit@debbugs.gnu.org id=B30327.151767538122696 (code B ref 30327); Sat, 03 Feb 2018 16:30:02 +0000 Original-Received: (at 30327) by debbugs.gnu.org; 3 Feb 2018 16:29:41 +0000 Original-Received: from localhost ([127.0.0.1]:55828 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ei0h9-0005tz-Gq for submit@debbugs.gnu.org; Sat, 03 Feb 2018 11:29:39 -0500 Original-Received: from mail-io0-f175.google.com ([209.85.223.175]:36360) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ei0h8-0005tm-2R for 30327@debbugs.gnu.org; Sat, 03 Feb 2018 11:29:38 -0500 Original-Received: by mail-io0-f175.google.com with SMTP id l17so26119991ioc.3 for <30327@debbugs.gnu.org>; Sat, 03 Feb 2018 08:29:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=YoI/93tDnQkXeT+aCOk1/+9mjMuZVNuYKmR1w+hHy/U=; b=QigF46LsazROhdXNHkMC185abgktPu58DVAgYR/FQl8miOdPXl3NbqFExrGd5yPhTv xQ/qcux4XNMexADHRsiWdt3joV8Q94aJfpWp7TmTfM4iM5mDOv9ghx+wo+U+bZFCXnUP FK5Aic5xRieEWXsD/R65IWbY62iy4DCrE44Kgr+EU7KBTkwzbMcOhvy3wmmTigDn8zrh vPlAEtb6N1hmavqT/ECU3QI0wCLqbdlKPYgY+St/pj4acu/VttckfAPCiPkUlT9TWbTz 3Y4mHbcAmbRKC0ydNUn8P6900jZuMmPJc1mUKxmDnBGenUOS9iaaioK7axLG77VLYooh b2xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=YoI/93tDnQkXeT+aCOk1/+9mjMuZVNuYKmR1w+hHy/U=; b=p3t9/eT+PbT3fEm/WcGv60w1bz2VMH66LSOcjtZIeJI1zKSi7M1hlIux4uZ6+rJriQ e35oHF94tqr2o86z3fMjPix8hD1R6tl+px3Ifs3W3C32+620IcuBC/om/z/VAUTLzY4F dQKU3/G3DJbe0f18LagKNsrbNRh4JZNpfgrKxWNhRUiTf5tgTwAKIAsq9kNB+SLj4gKF xgXym90qTtCkNy6NQtmL9rhapk56Fy59YFISBJcLto8bjnQfI1qdf2hN7CzVFCYV7PNX nSOosIymthuqGoX5B+VAQ1UzsdTaYepBXyHGdjL+5usIRRlBtVd0YrfXXg3jDSV1Bzf2 FX1Q== X-Gm-Message-State: AKwxytd6LVMHN5Bs29StlCIprY5+bXMyFpn74GoixSyGnxzZtvg4+oq5 REjNV4WAP54QY182jjX+buA+tw== X-Google-Smtp-Source: AH8x227gZ3mK5C8Em7ldQ6M1e+aGLX71XjlwuNW3plTHsbUQGvb7jgCUmDvRIdarKIZu41JRDEfr7A== X-Received: by 10.107.178.78 with SMTP id b75mr5808329iof.202.1517675372212; Sat, 03 Feb 2018 08:29:32 -0800 (PST) Original-Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id x2sm2724583ite.10.2018.02.03.08.29.30 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 03 Feb 2018 08:29:30 -0800 (PST) In-Reply-To: <20180203161311.GA17938@breton.holly.idiocy.org> (Alan Third's message of "Sat, 3 Feb 2018 16:13:11 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:142850 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Alan Third writes: > On Sat, Feb 03, 2018 at 12:47:29AM -0500, Noam Postavsky wrote: >> Philipp Stephani writes: >>=20 >> > The differing element is the last access time. This isn't surprising >> > given that reading the directory accesses it. Probably the test >> > should simply ignore the fifth element (the access time).=C2=A0 >>=20 >> Ah, good point. I went through all the different file handlers pretty >> quickly when writing these tests, so I missed these details. It passes >> for me because I mount with 'relatime'. >>=20 >> Element 9 is "unspecified", so I think we shouldn't check that either. > > The patch makes it even worse with two failures now: Sorry about that, I made some initial fix, then after testing, extended it, but completely forgot to actually try out the extended version. Here's a patch actually works on my box (and hopefully on others too). --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=v2-0001-Don-t-require-all-file-attributes-to-be-equal-Bug.patch Content-Description: patch >From 0276d2e2d438a4f9606e708ef6367800ad7a5bfc Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sat, 3 Feb 2018 00:44:45 -0500 Subject: [PATCH v2] ; Don't require all file-attributes to be equal (Bug#30327) * test/lisp/files-tests.el (files-tests-file-attributes-equal): New function. (files-tests-file-name-non-special-directory-files-and-attributes) (files-tests-file-name-non-special-file-attributes): Use it instead of `equal'. --- test/lisp/files-tests.el | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el index 3879ca8731..2c651c6715 100644 --- a/test/lisp/files-tests.el +++ b/test/lisp/files-tests.el @@ -408,10 +408,23 @@ files-tests--with-temp-file (should (equal (directory-files nospecial-dir) (directory-files tmpdir))))) +(defun files-tests-file-attributes-equal (attr1 attr2) + ;; Element 4 is access time, which may be changed by the act of + ;; checking the attributes. + (setf (nth 4 attr1) nil) + (setf (nth 4 attr2) nil) + ;; Element 9 is unspecified. + (setf (nth 9 attr1) nil) + (setf (nth 9 attr2) nil) + (equal attr1 attr2)) + (ert-deftest files-tests-file-name-non-special-directory-files-and-attributes () (files-tests--with-temp-non-special (tmpdir nospecial-dir t) - (should (equal (directory-files-and-attributes nospecial-dir) - (directory-files-and-attributes tmpdir))))) + (cl-loop for (file1 . attr1) in (directory-files-and-attributes nospecial-dir) + for (file2 . attr2) in (directory-files-and-attributes tmpdir) + do + (should (equal file1 file2)) + (should (files-tests-file-attributes-equal attr1 attr2))))) (ert-deftest files-tests-file-name-non-special-dired-compress-handler () ;; `dired-compress-file' can get confused by filenames with ":" in @@ -442,7 +455,8 @@ files-tests--with-temp-file (ert-deftest files-tests-file-name-non-special-file-attributes () (files-tests--with-temp-non-special (tmpfile nospecial) - (should (equal (file-attributes nospecial) (file-attributes tmpfile))))) + (should (files-tests-file-attributes-equal + (file-attributes nospecial) (file-attributes tmpfile))))) (ert-deftest files-tests-file-name-non-special-file-directory-p () (files-tests--with-temp-non-special (tmpdir nospecial-dir t) -- 2.11.0 --=-=-=--