bgrep: add test

Closes #26482.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>