summaryrefslogtreecommitdiff
path: root/bin/tests/test_string.cpp
diff options
context:
space:
mode:
authorKostadin Damyanov <maxmight@gmail.com>2015-08-09 12:45:21 +0300
committerKostadin Damyanov <maxmight@gmail.com>2015-08-09 12:45:21 +0300
commitcdf1ac7d58f3dc026cd316a66450771762d74432 (patch)
tree635ab608220b2940674098253efddbca7a69377a /bin/tests/test_string.cpp
parentf5bfd497aab7e24a6f4dc0315e9e9333504067a0 (diff)
parentc2e2f2e0aebf6342e6f18ae5d67b6a825590675a (diff)
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'bin/tests/test_string.cpp')
-rw-r--r--bin/tests/test_string.cpp22
1 files changed, 9 insertions, 13 deletions
diff --git a/bin/tests/test_string.cpp b/bin/tests/test_string.cpp
index 3c8d0f7d86..93b1835b78 100644
--- a/bin/tests/test_string.cpp
+++ b/bin/tests/test_string.cpp
@@ -31,7 +31,7 @@
//#include "math_funcs.h"
#include <stdio.h>
#include "os/os.h"
-#include "drivers/trex/regex.h"
+#include "drivers/nrex/regex.h"
#include "test_string.h"
@@ -463,20 +463,16 @@ bool test_26() {
OS::get_singleton()->print("\n\nTest 26: RegEx\n");
RegEx regexp("(.*):(.*)");
- List<String> captures;
- bool match = regexp.match("name:password", &captures);
- printf("\tmatch: %s\n", match?"true":"false");
+ int res = regexp.find("name:password");
+ printf("\tmatch: %s\n", (res>=0)?"true":"false");
- printf("\t%i captures:\n", captures.size());
- List<String>::Element *I = captures.front();
- while (I) {
-
- printf("%ls\n", I->get().c_str());
-
- I = I->next();
- };
- return captures.size();
+ printf("\t%i captures:\n", regexp.get_capture_count());
+ for (int i = 0; i<regexp.get_capture_count(); i++)
+ {
+ printf("%ls\n", regexp.get_capture(i).c_str());
+ }
+ return res;
};
struct test_27_data {