From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Vladimir Kazanov Newsgroups: gmane.emacs.bugs Subject: bug#69714: 30.0.50; ert-font-lock doesn't handle list of faces Date: Mon, 11 Mar 2024 08:36:22 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29392"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 69714@debbugs.gnu.org To: brownts@troybrown.dev Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Mar 11 09:39:14 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 1rjbBi-0007Qy-Bi for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 11 Mar 2024 09:39:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rjbB0-0007r0-T1; Mon, 11 Mar 2024 04:38:30 -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 1rjbAy-0007qS-OA for bug-gnu-emacs@gnu.org; Mon, 11 Mar 2024 04:38:28 -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 1rjbAy-0002xp-GF for bug-gnu-emacs@gnu.org; Mon, 11 Mar 2024 04:38:28 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rjbBV-0006dd-QP for bug-gnu-emacs@gnu.org; Mon, 11 Mar 2024 04:39:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Vladimir Kazanov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Mar 2024 08:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69714 X-GNU-PR-Package: emacs Original-Received: via spool by 69714-submit@debbugs.gnu.org id=B69714.171014629625454 (code B ref 69714); Mon, 11 Mar 2024 08:39:01 +0000 Original-Received: (at 69714) by debbugs.gnu.org; 11 Mar 2024 08:38:16 +0000 Original-Received: from localhost ([127.0.0.1]:38641 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjbAm-0006cU-1v for submit@debbugs.gnu.org; Mon, 11 Mar 2024 04:38:16 -0400 Original-Received: from mail-lf1-f44.google.com ([209.85.167.44]:57810) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjbAk-0006cH-0e for 69714@debbugs.gnu.org; Mon, 11 Mar 2024 04:38:14 -0400 Original-Received: by mail-lf1-f44.google.com with SMTP id 2adb3069b0e04-513b16bb739so116355e87.3 for <69714@debbugs.gnu.org>; Mon, 11 Mar 2024 01:37:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710146194; x=1710750994; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=YgVO7doFryW5ubmOS2TNXBjqMSFOJMy3sCi93V1gFXE=; b=K7NXZ0noclg0raFEAOCNR62ZzCulJuWMUQUMxehmrMZUXXDXu7aDZFSp308LmFSDXp 4b1sKXmGF6u0FglXA+2eG1lVBAJcpXT+V1jZiS+fTI8LwPGnC3IGdpgFmbQDXKB9Bjzl qrSVzx5zQo9nY4Cl1Eb6Q5FRkiPlL7pO1P2JNBOXtIV/Tm+F1jW10jsKnEzsKkoq/ZTn S0KINHtolUr8PeJKZmI2PNdwUm0ITd+fMw6NMrZrak//Kl10t43xn4q9SKE4WKPaYUlK alpXUC0nYQRduM4+8qogrMzNVS/hMasryPi920IbrKd0DUORGaQq2EV4cQGZbWLZQLIJ e6lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710146194; x=1710750994; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=YgVO7doFryW5ubmOS2TNXBjqMSFOJMy3sCi93V1gFXE=; b=RAVocQ6pMtFakp6agIRTF2yrtOjnJwa07svJBTRH5kSvioDt/UOByZZcIng7ZF5btt QDAlV5xz+jyC+qAmSI6rLtnIxBcGtHpMKdabG6VZdU9MPdEarQJKdSh0wAsodYqxb+D6 7RT7ppjEp76hqeqK/GcpzN93rWCa/nIgsY338rCpH4eHqTAmXUW1QZF1orPfO1+cMBvF zSxVYtLHfp5EF0do6/kwZkXFjN+/DnQT9t7lvzKqbW54l+cKo52Zr8f41D13M9njvxLX t0ag3RC6N6AKJqwHFGzaYZ8fZd/K1z/aGA3bBfEDvRg+bMdgwsXLvbzi4kFsAVnxfjVP fDZg== X-Gm-Message-State: AOJu0Yxo2jq/XQ2sp2CgxPfaia/DhhtllyKwZvlBQixadD4T8K9LYzYd 2fdhx9FYohisulxO5wOsdmqtYdDbvhGivhhG/JAttpHMbOk0l36OoPzZowRrMVOitNvICvDTOku O9Ih1mkxlsJ3LhFbS/zy6QOiIYw== X-Google-Smtp-Source: AGHT+IHMv7yOYke7MRUG2yvZXeHEd7ZiCMUmGYrBfyRVOT3tnnpJHx/yBSTeWj4Qh7JuOAiYnNlyP1gv8UhP7o0p/wc= X-Received: by 2002:a19:5513:0:b0:512:fc60:38e4 with SMTP id n19-20020a195513000000b00512fc6038e4mr3222209lfe.54.1710146193889; Mon, 11 Mar 2024 01:36:33 -0700 (PDT) In-Reply-To: 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:281458 Archived-At: Hi, Thanks for reporting this! I have a bunch of ert-font-lock improvements in my local repo getting ready for submission, and can look into your suggestions as well. Do you have your unit test code somewhere in a public repo? It'd be great to think of further improvements to support your use case. Thanks, Vlad On Sun, 10 Mar 2024 at 20:33, Troy Brown wrote: > > I'm trying to use this package to test out my tree-sitter mode, but am > running into an issue with lists of faces. It's possible that the > face for a location in the buffer will contain a list of 1 or more > faces. For example, when I use the ":override 'prepend" keyword in > the call to treesit-font-lock-rules, even if only a single face is > specified for the rule that matches that section of the buffer, this > will result in a list of one entry (i.e., "(face-name)"). > > When this happens, ert-font-lock fails to recognize that this matches > the face "face-name" (e.g., "^ face-name" will fail to match in this > case). I feel the tool should recognize a list containing a single > face as matching the face. Even worse however, it appears > ert-font-lock doesn't support a list of faces in the comment. I tried > to work around the original issue by using "^ (face-name)", but the > tool silently ignores this, as it doesn't match the internal regular > expression (which ended up allowing my test to pass without actually > checking anything). > > I can't figure out a way to use this tool in its current state due to > its lack of support for a list of faces. Also, I find that since it > silently ignores incorrect comment syntax (e.g., "^face-name", "^ > (face-name)"), it gives a false illusion that it's actually performing > those checks (and the checks are passing), when it's really just > ignoring them. Maybe any comment line starting with a "^" or "<-" > should be considered an assertion check and to fail if the rest of the > syntax is not as expected. Maybe it should also fail the test if no > assertion checks are found in a source file or string. > > Even if the tool would allow a list of a single face to match the > supplied face in the comment, I think it should also allow for > multiple faces to be listed in the comment. I have other places where > multiple faces are used (e.g., "(font-lock-constant-face > font-lock-variable-name-face)" to highlight a constant variable), > which would not be testable with the current state of the package. > > > -- Regards, Vladimir Kazanov