Test: Made \d a DARWIN-only test and added portable alternatives
This commit is contained in:
@@ -34,7 +34,7 @@ Context context;
|
|||||||
|
|
||||||
int main (int argc, char** argv)
|
int main (int argc, char** argv)
|
||||||
{
|
{
|
||||||
UnitTest ut (24);
|
UnitTest ut (26);
|
||||||
|
|
||||||
// Ensure environment has no influence.
|
// Ensure environment has no influence.
|
||||||
unsetenv ("TASKDATA");
|
unsetenv ("TASKDATA");
|
||||||
@@ -119,9 +119,21 @@ int main (int argc, char** argv)
|
|||||||
ut.ok (r12.match (text), text + " =~ /\\bthe\\b/");
|
ut.ok (r12.match (text), text + " =~ /\\bthe\\b/");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(DARWIN)
|
||||||
text = "D0";
|
text = "D0";
|
||||||
RX r13 ("D\\d");
|
RX r13 ("D\\d");
|
||||||
ut.ok (r13.match (text), text + " =~ /D\\d/");
|
ut.ok (r13.match (text), text + " =~ /D\\d/");
|
||||||
|
#else
|
||||||
|
ut.skip (" =~ /D\\d/"")
|
||||||
|
#endif
|
||||||
|
|
||||||
|
text = "D0";
|
||||||
|
RX r14 ("D[[:digit:]]");
|
||||||
|
ut.ok (r14.match (text), text + " =~ /D[[:digit:]]/");
|
||||||
|
|
||||||
|
text = "D0";
|
||||||
|
RX r15 ("D[0-9]");
|
||||||
|
ut.ok (r15.match (text), text + " =~ /D[0-9]/");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user