From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mariano Montone Newsgroups: gmane.emacs.devel Subject: Proposal: ert-run-test-at-point Date: Fri, 9 Sep 2022 12:04:51 -0300 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4019"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 To: Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Sep 09 17:07:24 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oWfbI-0000wf-67 for ged-emacs-devel@m.gmane-mx.org; Fri, 09 Sep 2022 17:07:24 +0200 Original-Received: from localhost ([::1]:58736 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oWfbH-0002O8-1Q for ged-emacs-devel@m.gmane-mx.org; Fri, 09 Sep 2022 11:07:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41734) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oWfZ2-0000RV-9E for emacs-devel@gnu.org; Fri, 09 Sep 2022 11:05:04 -0400 Original-Received: from mail-ot1-x32d.google.com ([2607:f8b0:4864:20::32d]:41649) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oWfZ0-0000o3-OS for emacs-devel@gnu.org; Fri, 09 Sep 2022 11:05:04 -0400 Original-Received: by mail-ot1-x32d.google.com with SMTP id t8-20020a9d5908000000b0063b41908168so1226411oth.8 for ; Fri, 09 Sep 2022 08:05:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:subject:from:to:content-language :user-agent:mime-version:date:message-id:from:to:cc:subject:date; bh=saVCZnmGfdGMtyWjceck0/vg7FlfTomYIdgs3HSzltE=; b=MEbtpzizCbIfZynsgu6GxHtpNdx/n3Gh42H+IXfkLtIWwdw/bhPvbzNndUSHoUpu5I CA6x5rB5zdFI/wA0QUo/Zey+y+ZHHCsYg+oF86yeBlonkrpVoWZOFoa2pOADLMkzgdCk vaiHtgp3r5iFO5RCCuFRjhtRn8KbH3uNGn61jtGkNw/4C2dA/5TmebTcKeTvNj8FnDx3 EXLIKmBEEKdkNoal6s51C80fy/YWM/RGn8BI1KoIQrj5vgAxEgQxYgyFFQohYGQZyHTR zmaqQfZWSk26tNm8eXQGGnvfckXea/F6CwIcq3vfW1ISEociKy9YzK7PHi3VpPafoFEL +P2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:subject:from:to:content-language :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date; bh=saVCZnmGfdGMtyWjceck0/vg7FlfTomYIdgs3HSzltE=; b=X1FSyKaEZyZkqYjZT3CduzM2naeOedixisGav0X+mOYfGk+8bLpM+wuE3J79FK43xW F8+vGqFuGDvxOoPuiLqDS6DOSWn2CTU0Uk3S7cIAxaY5ISGdE6V0/DqJiHkWqdg8Y6fi 21Q+yLVwIfCb92b6JpnMaW58di12pKMF8siK+L5sFYT/cZoADpWECGhjXMFbQ554mQvo H+buD/gtTyKs8K1PnGa+6LuQmCqxPRzlHU2n3XFchWO9Gf3vv61dzkCq+aOXOVP4HJuP Fj32Ia4zGRvNJs+JdRWhEiSsMQk5F4bFNNiqH/+ZDpPhXXanX58LOTsXwgHnPHD5wZI+ K8/w== X-Gm-Message-State: ACgBeo2KDkgq/0yInCWDDQEwIWOKoqlMfkv41YOa3Bqa4s38HkRpvFpw xWDrpFfSYmA1+bedBTLSIbXejhDXj20= X-Google-Smtp-Source: AA6agR6Q6uBGkCmCqK5P1/O7MBnS6O+NsPmBRP6rQg0+Tw3mbFzFhiOpXySZdp1WlItvvxHSTMDEYQ== X-Received: by 2002:a05:6830:4ce:b0:638:f7cb:2f80 with SMTP id s14-20020a05683004ce00b00638f7cb2f80mr5413922otd.172.1662735897730; Fri, 09 Sep 2022 08:04:57 -0700 (PDT) Original-Received: from [192.168.0.3] ([190.17.4.55]) by smtp.googlemail.com with ESMTPSA id cm9-20020a056870b60900b00118687c3907sm440767oab.24.2022.09.09.08.04.54 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 09 Sep 2022 08:04:55 -0700 (PDT) Content-Language: es-CO Received-SPF: pass client-ip=2607:f8b0:4864:20::32d; envelope-from=marianomontone@gmail.com; helo=mail-ot1-x32d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:295073 Archived-At: Hello, I have this in my .emacs, for quickly running the ert test at cursor point: ;; run ert test at point (defun defun-at-point ()   "Return the text of the defun at point."   (apply #'buffer-substring-no-properties          (region-for-defun-at-point))) (defun region-for-defun-at-point ()   "Return the start and end position of defun at point."   (save-excursion     (save-match-data       (end-of-defun)       (let ((end (point)))         (beginning-of-defun)         (list (point) end))))) (defun ert-run-test-at-point ()   "Run the ert test at point."   (interactive)   (let* ((test-form (read-from-string (defun-at-point)))      (test-name (cadar test-form)))     (ert test-name))) Then I bind ert-run-test-at-point to C-c C-t (locally to the buffer with the tests), and I'm able to quickly run the tests at cursor point as I write them. I think it would be cool if something like this came by default with ERT.      Mariano