Add a means to pass in a string comparison.

This should allow for more robust error reporting in the string=comparison failure case.