I believe that after https://reviews.llvm.org/D102355 the behaviour of --print-source-context-lines has changed.
Before: --print-source-context-lines=3 prints 4 lines.
After: --print-source-context-lines=3 prints 3 lines.
Adjust the example in the docs for this change and make the testing a little more robust.
A note in passing: This option is a bit confusing. I feel it would be better to follow existing conventions e.g.:
--print-source-context-lines=1 prints 1 line before and after as well as the matching line.
--print-source-after-lines=1 prints 1 line after the matching line as well as the matching line.
--print-source-before-lines=1 prints 1 line before the matching line as well as the matching line.
Maybe -C/-A/-B are available to match grep because the current option is quite long?