Add a test to detect error when attempting to syntax-check a directory.

For: RT #61362