[clang-tools-extra] [clang-doc] Replace HTML-CHECK commands with HTML-CHECK-NEXT commands (PR #181330)
Paul Kirth via cfe-commits
cfe-commits at lists.llvm.org
Fri Feb 13 15:32:37 PST 2026
================
@@ -8,557 +8,572 @@
// RUN: FileCheck %s -input-file=%t/docs/html/GlobalNamespace/_ZTV6Circle.html -check-prefix=HTML-CIRCLE
HTML-SHAPE: <html lang="en-US">
-HTML-SHAPE: <head>
-HTML-SHAPE: <meta charset="utf-8"/>
-HTML-SHAPE: <title>Shape</title>
-HTML-SHAPE: <link rel="stylesheet" type="text/css" href="../clang-doc-mustache.css"/>
-HTML-SHAPE: <script src="../mustache-index.js"></script>
-HTML-SHAPE: <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css">
-HTML-SHAPE: <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
-HTML-SHAPE: <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/cpp.min.js"></script>
-HTML-SHAPE: </head>
-HTML-SHAPE: <body>
-HTML-SHAPE: <nav class="navbar">
-HTML-SHAPE: <div class="navbar__container">
-HTML-SHAPE: <div class="navbar__logo">
-HTML-SHAPE: </div>
-HTML-SHAPE: <div class="navbar__menu">
-HTML-SHAPE: <ul class="navbar__links">
-HTML-SHAPE: <li class="navbar__item">
-HTML-SHAPE: <a href="../index.html" class="navbar__link">Home</a>
-HTML-SHAPE: </li>
-HTML-SHAPE: </ul>
-HTML-SHAPE: </div>
-HTML-SHAPE: </div>
-HTML-SHAPE: <div class="navbar-breadcrumb-container">
-HTML-SHAPE: <a href="./index.html"><div class="navbar-breadcrumb-item">Global Namespace</div></a>
-HTML-SHAPE: </div>
-HTML-SHAPE: </nav>
-HTML-SHAPE: <main>
-HTML-SHAPE: <div class="container">
-HTML-SHAPE: <div class="sidebar">
-HTML-SHAPE: <h2>class Shape</h2>
-HTML-SHAPE: <ul>
-HTML-SHAPE: <li>
-HTML-SHAPE: <details open>
-HTML-SHAPE: <summary class="sidebar-section">
-HTML-SHAPE: <a class="sidebar-item" href="#PublicMethods">Public Methods</a>
-HTML-SHAPE: </summary>
-HTML-SHAPE: <ul>
-HTML-SHAPE: <li class="sidebar-item-container">
-HTML-SHAPE: <a class="sidebar-item" href="#{{([0-9A-F]{40})}}">area</a>
-HTML-SHAPE: </li>
-HTML-SHAPE: <li class="sidebar-item-container">
-HTML-SHAPE: <a class="sidebar-item" href="#{{([0-9A-F]{40})}}">perimeter</a>
-HTML-SHAPE: </li>
-HTML-SHAPE: <li class="sidebar-item-container">
-HTML-SHAPE: <a class="sidebar-item" href="#{{([0-9A-F]{40})}}">~Shape</a>
-HTML-SHAPE: </li>
-HTML-SHAPE: </ul>
-HTML-SHAPE: </details>
-HTML-SHAPE: </li>
-HTML-SHAPE: </ul>
-HTML-SHAPE: </div>
-HTML-SHAPE: <div class="resizer" id="resizer"></div>
-HTML-SHAPE: <div class="content">
-HTML-SHAPE: <section class="hero section-container">
-HTML-SHAPE: <div class="hero__title">
-HTML-SHAPE: <h1 class="hero__title-large">class Shape</h1>
-HTML-SHAPE: <div class="doc-card">
-HTML-SHAPE: <div class="nested-delimiter-container">
-HTML-SHAPE: <p> Abstract base class for shapes.</p>
-HTML-SHAPE: </div>
-HTML-SHAPE: <div class="nested-delimiter-container">
-HTML-SHAPE: <p> Provides a common interface for different types of shapes.</p>
-HTML-SHAPE: </div>
-HTML-SHAPE: </div>
-HTML-SHAPE: </div>
-HTML-SHAPE: </section>
-HTML-SHAPE: <section id="PublicMethods" class="section-container">
-HTML-SHAPE: <h2>Public Methods</h2>
-HTML-SHAPE: <div id="{{([0-9A-F]{40})}}" class="delimiter-container">
-HTML-SHAPE: <pre><code class="language-cpp code-clang-doc">double area ()</code></pre>
-HTML-SHAPE: <div class="doc-card">
-HTML-SHAPE: <div class="nested-delimiter-container">
-HTML-SHAPE: <p> Calculates the area of the shape.</p>
-HTML-SHAPE: </div>
-HTML-SHAPE: <div class="nested-delimiter-container">
-HTML-SHAPE: <h3>Returns</h3>
-HTML-SHAPE: <p> double The area of the shape.</p>
-HTML-SHAPE: </div>
-HTML-SHAPE: </div>
-HTML-SHAPE: </div>
-HTML-SHAPE: <div id="{{([0-9A-F]{40})}}" class="delimiter-container">
-HTML-SHAPE: <pre><code class="language-cpp code-clang-doc">double perimeter ()</code></pre>
-HTML-SHAPE: <div class="doc-card">
-HTML-SHAPE: <div class="nested-delimiter-container">
-HTML-SHAPE: <p> Calculates the perimeter of the shape.</p>
-HTML-SHAPE: </div>
-HTML-SHAPE: <div class="nested-delimiter-container">
-HTML-SHAPE: <h3>Returns</h3>
-HTML-SHAPE: <p> double The perimeter of the shape.</p>
-HTML-SHAPE: </div>
-HTML-SHAPE: </div>
-HTML-SHAPE: </div>
-HTML-SHAPE: <div id="{{([0-9A-F]{40})}}" class="delimiter-container">
-HTML-SHAPE: <pre><code class="language-cpp code-clang-doc">void ~Shape ()</code></pre>
-HTML-SHAPE: <div class="doc-card">
-HTML-SHAPE: <div class="nested-delimiter-container">
-HTML-SHAPE: <p> Virtual destructor.</p>
-HTML-SHAPE: </div>
-HTML-SHAPE: </div>
-HTML-SHAPE: </div>
-HTML-SHAPE: </section>
-HTML-SHAPE: </div>
-HTML-SHAPE: </div>
-HTML-SHAPE: </main>
-HTML-SHAPE: </body>
-HTML-SHAPE: </html>
+HTML-SHAPE-NEXT: <head>
+HTML-SHAPE-NEXT: <meta charset="utf-8"/>
+HTML-SHAPE-NEXT: <title>Shape</title>
+HTML-SHAPE-NEXT: <link rel="stylesheet" type="text/css" href="../clang-doc-mustache.css"/>
+HTML-SHAPE-NEXT: <script src="../mustache-index.js"></script>
+HTML-SHAPE-NEXT: <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css">
+HTML-SHAPE-NEXT: <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
+HTML-SHAPE-NEXT: <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/cpp.min.js"></script>
+HTML-SHAPE-NEXT: </head>
+HTML-SHAPE-NEXT: <body>
+HTML-SHAPE-NEXT: <header>
+HTML-SHAPE-NEXT: <nav class="navbar">
+HTML-SHAPE-NEXT: <div class="navbar__container">
+HTML-SHAPE-NEXT: <div class="navbar__logo">
+HTML-SHAPE-NEXT: {{^ +$}}
----------------
ilovepi wrote:
We don't want matches like this in the test. they are brittle, and can potentially match unwanted items. If EMPTY does not work, I'd drop this entirely.
I'm also a bit concerned that you say "some lines are not completely blank". If you're using -NEXT, then it should only ever match a single line in the output.
https://github.com/llvm/llvm-project/pull/181330
More information about the cfe-commits
mailing list