From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Randy Taylor Newsgroups: gmane.emacs.bugs Subject: bug#70939: [PATCH] Add commands to run unit tests in go-ts-mode Date: Wed, 15 May 2024 02:36:15 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14935"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , 70939@debbugs.gnu.org To: Ankit Gadiya Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed May 15 04:37:19 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1s74W6-0003em-S7 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 15 May 2024 04:37:18 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s74Vr-0003jg-F6; Tue, 14 May 2024 22:37:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s74Vp-0003j2-97 for bug-gnu-emacs@gnu.org; Tue, 14 May 2024 22:37:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s74Vp-0001tc-0W for bug-gnu-emacs@gnu.org; Tue, 14 May 2024 22:37:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s74Vp-0006VV-W8 for bug-gnu-emacs@gnu.org; Tue, 14 May 2024 22:37:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Randy Taylor Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 May 2024 02:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70939 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 70939-submit@debbugs.gnu.org id=B70939.171574059324994 (code B ref 70939); Wed, 15 May 2024 02:37:01 +0000 Original-Received: (at 70939) by debbugs.gnu.org; 15 May 2024 02:36:33 +0000 Original-Received: from localhost ([127.0.0.1]:41691 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s74VM-0006V4-NB for submit@debbugs.gnu.org; Tue, 14 May 2024 22:36:33 -0400 Original-Received: from mail-40136.proton.ch ([185.70.40.136]:48661) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s74VH-0006Uv-Ga for 70939@debbugs.gnu.org; Tue, 14 May 2024 22:36:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rjt.dev; s=protonmail2; t=1715740580; x=1715999780; bh=Rca3skJjF1muQVV92i/xeyxyT7akf8cFiWM42c/140M=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=RmsysIW2Hmzrq7GJ7QTKIfp/Vbqy7oX3o6WhUNQDW4lntC9EczY6iPo0wq8tW6rez /QYfg82/RWvSuR/xY0Nj3HCNS0EtcJ5v/qH9Obb1FD9fhtQnvcAT1LmeMJfhs6+B19 lYFtE+DYGXm2lYdFMeN9gZ6n8Rthcc3jKbpzWzlFvjJY5gLiTuc4ylsTCKjF33cdzx AaT3OnF0KQVDga3TdQK+cW07l1mo5fI3KuTXylgXYyZ2j0pDzE2Poz10un6V4YF46w x58gYtjiE2YPB2u8liBfAxGqCD2YXYCaHamgB3aE/uSd55bS86ehjWp0v6EZtOskEe 3R1hkHiRXT35w== In-Reply-To: Feedback-ID: 44397038:user:proton X-Pm-Message-ID: 459e439fde3d352b3f5d45d27e023795801f6889 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:285061 Archived-At: On Tuesday, May 14th, 2024 at 10:04, Ankit Gadiya via "Bug reports for GNU = Emacs, the Swiss army knife of text editors" wrote: > Hello folks, >=20 > This patch adds two new commands for go-ts-mode to run unit test cases. >=20 > The go-ts-mode-test-package command can run all the tests under the packa= ge of > the current buffer. I've tested it to work with both Go module packages a= nd > non-module packages. This command is bound to C-c C-p in the go-ts-mode-m= ap. >=20 > The go-ts-mode-test-function-at-point command runs the current test funct= ion. If > region is active then it runs all the test functions under the region. I'= m > attaching a sample_test.go file as well for reviewers to test the patch. = This > command is bound to C-c C-t in the go-ts-mode-map. >=20 > -- > Ankit Thanks for working on this, it would certainly be a nice addition. This is going to need a commit log entry. See the "Commit messages" section in the CONTRIBUTING file. I'm undecided on the keybinds. I think I would prefer something like: C-c t p or C-c C-t p so we can keep test-related things together. I haven't tried this out yet, but here are some comments (mostly nits) after a quick look: In NEWS, sentences should be separated by 2 spaces. +The 'go-ts-mode-test-function-at-point' command runs unit test at ^the +point. +This function respects `go-build-tags' buffer-local variable ^the + "Compiles the tests matching REGEXP. ^Compile +If the point is anywhere in the test function, that function will be +tested. ^ run (keeps it consistent with the next sentence) + "Run all the unit tests under current package." ^the