From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Troy Brown Newsgroups: gmane.emacs.bugs Subject: bug#69714: 30.0.50; ert-font-lock doesn't handle list of faces Date: Sun, 10 Mar 2024 16:31:58 -0400 Message-ID: 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="30523"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Vladimir Kazanov To: 69714@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Mar 10 21:33:00 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 1rjPqu-0007nd-Fk for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 10 Mar 2024 21:33:00 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rjPqb-0007hB-BC; Sun, 10 Mar 2024 16:32:42 -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 1rjPqR-0007gn-PY for bug-gnu-emacs@gnu.org; Sun, 10 Mar 2024 16:32:32 -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 1rjPqP-00064O-UX for bug-gnu-emacs@gnu.org; Sun, 10 Mar 2024 16:32:30 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rjPqw-0004Eu-KG for bug-gnu-emacs@gnu.org; Sun, 10 Mar 2024 16:33:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Troy Brown Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 10 Mar 2024 20:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 69714 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.171010277116277 (code B ref -1); Sun, 10 Mar 2024 20:33:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 10 Mar 2024 20:32:51 +0000 Original-Received: from localhost ([127.0.0.1]:38063 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjPqk-0004ET-SJ for submit@debbugs.gnu.org; Sun, 10 Mar 2024 16:32:51 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:46506) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjPqi-0004EL-Pg for submit@debbugs.gnu.org; Sun, 10 Mar 2024 16:32:49 -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 1rjPqA-0007eZ-OT for bug-gnu-emacs@gnu.org; Sun, 10 Mar 2024 16:32:14 -0400 Original-Received: from mail-lf1-f51.google.com ([209.85.167.51]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rjPq9-000626-3Y for bug-gnu-emacs@gnu.org; Sun, 10 Mar 2024 16:32:14 -0400 Original-Received: by mail-lf1-f51.google.com with SMTP id 2adb3069b0e04-5131c0691feso4904120e87.1 for ; Sun, 10 Mar 2024 13:32:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710102730; x=1710707530; h=cc:to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=cI5T5AnpEzCTfhwLFa2L6nUr6rjw1pV7Ko2/gu3nQVI=; b=irOQp4g3gNeOoD11IiFvkjnyknDcqiz1xiMpN8Ot8C1gPHrC9fw8zysAIXR6bzwrbv C8hrTYYDrtUKGZPpQFTJV2Z/l4nkf4ygUG4KuPDUNqSipXRsyPsHPL3qGkmY8ZO/KQN9 T8Fsd3gzJmtXhOhHh50SuLM17+JoXWPnlq9FHHokkOfPtt/iSQcaFinF1VQjHX+mkorH y/paoiXAtM+uLRj5DWTwE1JLCi6FDkvouQqj+oCtWelQUgN92442stVD+UucVHJb0Pte pQTExGyNqYNoZpHojSsOv+TmSPiX3cwbtCyP7zZXR5ckMmgp1oGtNA4koeNA8bTHDVjx oIiw== X-Gm-Message-State: AOJu0YzvDGyxQcKmCDrfo3qx9MV4A64KtS/xJJLoqborA1mubsyoQrjx R8I+G6YMjztkqELNhtRBvnewXAYFBqFYD7DPVxbp9rOvyxInAIonl9+ElGJjrSTTnz/7 X-Google-Smtp-Source: AGHT+IGmeRzQFYWmblNrdVwK+3Z8Us2AGe2n+Xm5YJNNWD2vSub4m69Bg/3PiF4jzF9kgwOAH9s8cw== X-Received: by 2002:ac2:530b:0:b0:513:a5be:225c with SMTP id c11-20020ac2530b000000b00513a5be225cmr1335454lfh.7.1710102730190; Sun, 10 Mar 2024 13:32:10 -0700 (PDT) Original-Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com. [209.85.218.43]) by smtp.gmail.com with ESMTPSA id a1-20020a509e81000000b00567216c1e9bsm2328107edf.88.2024.03.10.13.32.09 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 10 Mar 2024 13:32:09 -0700 (PDT) Original-Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-a44665605f3so558433866b.2 for ; Sun, 10 Mar 2024 13:32:09 -0700 (PDT) X-Received: by 2002:a17:907:7b06:b0:a46:2039:e8ff with SMTP id mn6-20020a1709077b0600b00a462039e8ffmr948525ejc.39.1710102729494; Sun, 10 Mar 2024 13:32:09 -0700 (PDT) X-Gmail-Original-Message-ID: Received-SPF: pass client-ip=209.85.167.51; envelope-from=troy.s.brown@gmail.com; helo=mail-lf1-f51.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action 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:281437 Archived-At: 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.