Add MacOS error messages to RegExp unit test.
@@ -13,19 +13,39 @@ testRun(void)
// *****************************************************************************************************************************
if (testBegin("regExpNew(), regExpMatch(), and regExpFree()"))
{
- // Error message varies based on the libc version
+ // Error message varies based on the libc version/OS
TRY_BEGIN()
{
+ // Older libc
TEST_ERROR(regExpNew(strNew("[[[")), FormatError, "Unmatched [ or [^");
}
CATCH(TestError)
{
+ TRY_BEGIN()
+ {
+ // Newer libc
TEST_ERROR(regExpNew(strNew("[[[")), FormatError, "Unmatched [, [^, [:, [., or [=");
}
+ CATCH(TestError)
+ {
+ // MacOS
+ TEST_ERROR(regExpNew(strNew("[[[")), FormatError, "brackets ([ ]) not balanced");
+ }
+ TRY_END();
+ }
TRY_END();
-
+ TRY_BEGIN()
+ {
+ // libc
TEST_ERROR(regExpErrorCheck(REG_BADBR), FormatError, "Invalid content of \\{\\}");
+ }
+ CATCH(TestError)
+ {
+ // MacOS
+ TEST_ERROR(regExpErrorCheck(REG_BADBR), FormatError, "invalid repetition count(s)");
+ }
+ TRY_END();
// -------------------------------------------------------------------------------------------------------------------------
TEST_TITLE("new regexp");
