From 0e3c35fbb15ce31426b9158efa91e35a3d1d7da6 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Wed, 29 Jul 2015 00:49:36 -0400 Subject: [PATCH] Test: Made \d a DARWIN-only test and added portable alternatives --- test/rx.t.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/test/rx.t.cpp b/test/rx.t.cpp index 27b22a635..eb001ee5b 100644 --- a/test/rx.t.cpp +++ b/test/rx.t.cpp @@ -34,7 +34,7 @@ Context context; int main (int argc, char** argv) { - UnitTest ut (24); + UnitTest ut (26); // Ensure environment has no influence. unsetenv ("TASKDATA"); @@ -119,9 +119,21 @@ int main (int argc, char** argv) ut.ok (r12.match (text), text + " =~ /\\bthe\\b/"); #endif +#if defined(DARWIN) text = "D0"; RX r13 ("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; }