mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Test: Made \d a DARWIN-only test and added portable alternatives
This commit is contained in:
parent
0221a7e742
commit
0e3c35fbb1
1 changed files with 13 additions and 1 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue