[clang] [clang][analyzer] Fix alignment of entries in -analyzer-help (PR #190570)

Justin Stitt via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 6 14:54:45 PDT 2026


https://github.com/JustinStitt commented:

A nit and a suggestion.

Could you add a test like:
```c
  TEST(PrintFormattedEntryTest, ExactFillWidthWithInitialPad) {
    llvm::SmallString<256> Buffer;
    runPrintFormattedEntry(/*EntryDescPair=*/{"Checkers", "A description"},
                           /*InitialPad=*/2,
                           /*EntryWidth=*/8,
                           /*MinLineWidth=*/0,
                           /*OutBuffer=*/Buffer);

    EXPECT_EQ(Buffer, "  Checkers\n"
                      "          A description");
  }
```

... which I believe tests the actual latent bug path. i.e., `Checkers` is exactly `8` characters long and `EntryWidth` is also `8`.

If you already added a test like this and I missed it then feel free to ignore me because LGTM otherwise.

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


More information about the cfe-commits mailing list