ansifilter: add test

Closes #26408.

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