[llvm] [utils][filecheck-lint]: speedup filecheck_lint (PR #94191)

Benjamin Chetioui via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 5 02:42:11 PDT 2024


================
@@ -49,27 +49,15 @@ def test_find_potential_directives_comment_prefix(self):
         results = list(fcl.find_potential_directives(content))
         assert len(results) == 3
         pos, match = results[0]
-        assert (
-            pos.line == 1
-            and pos.start_column == len("junk; ") + 1
-            and pos.end_column == len(lines[0]) - 1
-        )
+        assert pos.as_str() == "1:7-11"
----------------
bchetioui wrote:

> This looks like copypaste and not maintainable - change in input lines only will break tests without fixes here too.

The same tests will break in both cases.

> Maybe add comment like:

Adding a comment here is strictly worse; that too will get out of sync, but will do so completely silently since the comment doesn't get executed.

Anyway, this is not a huge deal, and you seem to feel strongly about this, so let's keep it as is.

https://github.com/llvm/llvm-project/pull/94191


More information about the llvm-commits mailing list