From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#27841: 25.2; Patch for completion-table-with-predicate Date: Mon, 07 Aug 2017 21:27:31 -0400 Message-ID: <874lti4zng.fsf@users.sourceforge.net> References: <87mv7f6j06.fsf@users.sourceforge.net> <10ad76ff-8e89-d8f2-1278-3fd04845b243@yandex.ru> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1502155650 15612 195.159.176.226 (8 Aug 2017 01:27:30 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 8 Aug 2017 01:27:30 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux) Cc: 27841@debbugs.gnu.org, Dmitry Gutov To: Ryan Thompson Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Aug 08 03:27:15 2017 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 1detId-0003AW-Gr for geb-bug-gnu-emacs@m.gmane.org; Tue, 08 Aug 2017 03:27:11 +0200 Original-Received: from localhost ([::1]:40328 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1detIj-0006l4-LB for geb-bug-gnu-emacs@m.gmane.org; Mon, 07 Aug 2017 21:27:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55083) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1detIZ-0006kQ-G7 for bug-gnu-emacs@gnu.org; Mon, 07 Aug 2017 21:27:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1detIU-0000d3-Ff for bug-gnu-emacs@gnu.org; Mon, 07 Aug 2017 21:27:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:42252) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1detIU-0000cu-Bg for bug-gnu-emacs@gnu.org; Mon, 07 Aug 2017 21:27:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1detIT-0001WV-VA for bug-gnu-emacs@gnu.org; Mon, 07 Aug 2017 21:27:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 08 Aug 2017 01:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27841 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 27841-submit@debbugs.gnu.org id=B27841.15021555635786 (code B ref 27841); Tue, 08 Aug 2017 01:27:01 +0000 Original-Received: (at 27841) by debbugs.gnu.org; 8 Aug 2017 01:26:03 +0000 Original-Received: from localhost ([127.0.0.1]:50933 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1detHX-0001VF-C6 for submit@debbugs.gnu.org; Mon, 07 Aug 2017 21:26:03 -0400 Original-Received: from mail-io0-f193.google.com ([209.85.223.193]:38122) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1detHV-0001Ui-JF for 27841@debbugs.gnu.org; Mon, 07 Aug 2017 21:26:02 -0400 Original-Received: by mail-io0-f193.google.com with SMTP id o9so1476184iod.5 for <27841@debbugs.gnu.org>; Mon, 07 Aug 2017 18:26:01 -0700 (PDT) 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=kaK8zpEESjx7RHRP58RpwAL1xKdbb/dkNtQ5nxW3En0=; b=drizxBCWIICFJpaa6BXORthrEmL1w85iTbTbNHGb1xGPY6gJHJPxNNt9zcGwGd9ArO nWhuRveRE7BrYfapozlha2cMAhH1D7GYkQAco/YRKE4NDuEPklYq88Sr1R0cZEkJ+wcr WwNbaUgQirLRx49kF7/HdA2C6fOpowNFRqNuKMfW5AOIAyvrnZrUk/13zJowCD+Mmnlv YNXXfAMxxu1LKPpqC+O1VnsmE3rHb66wRiCEYINbdaLT/5SmRxr5Cjh+D8oIic8URjFk rIvUk6LVCqqPF5gcAUa1SBbMGbs8zODsGfqG7jjnutT8+FSZ3OPGSuiWeiyDSq0iOZdV 0j3Q== 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=kaK8zpEESjx7RHRP58RpwAL1xKdbb/dkNtQ5nxW3En0=; b=aHhrFaOQKk0QtIZlWqYBr5mIHANZxbsC0udnW7TAeR6uaU6ZnugYi9Bh29GRBNAVtL LmPabNY0Mxa43gB8xtRjqBzGICGNBZ8M+ASpEvAGqjJ1oSO354wK9V8aEW1C6OYDOKZ4 BB1WumR4BOIuJUDaIhQvTv43m9BCpYYW5UfwCTCg3b/zjmuEGkwnNejNhakbir5Ijzim ge3YhzQcBIAcJ/J3Pk7HWeKhxVeDVL7gO0cy3VHN55ZNU/qNFarPKFKlwNAMVG9+LbHm nBD6C6aVmcpBs+BLXaFeuYLdzAJJOJqPF4cSjy1IktVWf50oXxbZstMDHA/4cHtYrIvl bVaA== X-Gm-Message-State: AIVw110KoX9TvIjN5hJhdX5kO/Yxff/H1KA+0Xw0LKkvGVdB6ELfGHmx XQ+/oDJq7SkSWl9/jTw= X-Received: by 10.107.15.16 with SMTP id x16mr2279697ioi.288.1502155555916; Mon, 07 Aug 2017 18:25:55 -0700 (PDT) Original-Received: from zony ([45.2.119.49]) by smtp.googlemail.com with ESMTPSA id a83sm64826ioj.36.2017.08.07.18.25.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 07 Aug 2017 18:25:54 -0700 (PDT) In-Reply-To: (Ryan Thompson's message of "Sat, 05 Aug 2017 06:22:39 +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:135562 Archived-At: Ryan Thompson writes: > Second, I notice that there is not much in this file, in particular > nothing testing interactive completion in the minibuffer. I recently > wrote a package for simulating interactive input to a command in order > to implement tests for my ido-comrpleting-read+ package, and it might > be useful for adding more tests here. You can view it here: > https://github.com/DarwinAwardWinner/with-simulated-input and view > example usage in the ido-cr+ test suite here: > https://github.com/DarwinAwardWinner/ido-completing-read-plus/blob/master/tests/test-ido-completing-read%2B.el > > Let me know if there is interest in using such an approach to add > automated tests for some of the core interactive Emacs functions like > "completing-read". Sounds like that a useful addition to me. > * ../lisp/minibuffer.el (completion-table-with-predicate): Don't > act as if strict is non-nil when pred2 is nil (Bug#27841). > * ../test/lisp/minibuffer-tests.el > (completion-table-with-predicate-test): Add a test for Bug#27841. I wonder how you ended up with the ../ prefix on the filenames? > +(ert-deftest completion-table-with-predicate-test () > + (cl-letf* ((full-collection > + '("apple" ; Has A > + "beet" ; Has B > + "banana" ; Has A & B > + "cherry" ; Has neither > + )) > + ((symbol-function 'no-A) > + (lambda (x) (not (string-match-p "a" x)))) > + ((symbol-function 'no-B) > + (lambda (x) (not (string-match-p "b" x))))) It looks to me like things would be simpler with a let instead of cl-letf, no?