This allows an Error string to contain a regular expression to be compiled and matched against the error output. If the Error string is delimited by slashes, it's used as a regular expression. Otherwise, the normal behavior (substring to be contained in the error output) is preserved.
Examples:
// Direct helper API
TestImportCase{Error: `normal substring`}
TestImportCase{Error: "normal substring"}
TestImportCase{Error: `/a \w+ pattern/`}
TestImportCase{Error: "/a \\w+ pattern/"}
# In a test file, the error pragma:
//error normal substring
//error /a \w+ pattern/
Errors in the given error pattern are helpfully surfaced, though this I found to be basically impossible to test because I don't know how to get the output to match on. (It's still tested, but like a similar other test in the suite, it just ensures that some sort of failure occurred) It looks like this:
This allows an Error string to contain a regular expression to be compiled and matched against the error output. If the Error string is delimited by slashes, it's used as a regular expression. Otherwise, the normal behavior (substring to be contained in the error output) is preserved.
Examples:
Errors in the given error pattern are helpfully surfaced, though this I found to be basically impossible to test because I don't know how to get the output to match on. (It's still tested, but like a similar other test in the suite, it just ensures that some sort of failure occurred) It looks like this: