[llvm] [lit] Add JSON diffing support to lit (PR #177513)

Henrik G. Olsson via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 6 20:04:25 PST 2026


================
@@ -0,0 +1,15 @@
+# Test capture pattern (@&) - comprehensive tests
+
+# Basic capture pattern - same value captured multiple times
+# RUN: json-diff %S/patterns-capture-expected.json %S/patterns-capture-actual.json
+
+# Capture pattern mismatch - different values for same capture name
+# RUN: not json-diff %S/patterns-capture-fail-expected.json %S/patterns-capture-fail-actual.json 2>&1 | FileCheck --check-prefix=MISMATCH %s
+# MISMATCH: Match failure: capture 'ID' mismatch: expected '123', got '999'.
----------------
hnrklssn wrote:

Can we capture the full output in some of these tests? I want to know what the difflib output looks like when using pattern matching, because I'm not quite sure how that would work.

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


More information about the llvm-commits mailing list