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
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to