diff options
author | vng <viktor.govako@gmail.com> | 2012-10-30 17:21:39 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:46:27 +0300 |
commit | f05dcc2e4838503e9ebc204cfa1c894bda9ff46f (patch) | |
tree | 95de4ed2114ee9fbfb6786cd0c32f61382e06b72 /platform/platform_tests | |
parent | b51574bdc59b52b4d8b77cd36d43c19a6ef3ee4e (diff) |
Add regexp routine (base on boost::expressive).
Diffstat (limited to 'platform/platform_tests')
-rw-r--r-- | platform/platform_tests/platform_tests.pro | 1 | ||||
-rw-r--r-- | platform/platform_tests/regexp_test.cpp | 22 |
2 files changed, 23 insertions, 0 deletions
diff --git a/platform/platform_tests/platform_tests.pro b/platform/platform_tests/platform_tests.pro index 29bee1215e..821e52437a 100644 --- a/platform/platform_tests/platform_tests.pro +++ b/platform/platform_tests/platform_tests.pro @@ -33,3 +33,4 @@ SOURCES += \ language_test.cpp \ downloader_test.cpp \ video_timer_test.cpp \ + regexp_test.cpp \ diff --git a/platform/platform_tests/regexp_test.cpp b/platform/platform_tests/regexp_test.cpp new file mode 100644 index 0000000000..7e0e0dea35 --- /dev/null +++ b/platform/platform_tests/regexp_test.cpp @@ -0,0 +1,22 @@ +#include "../../testing/testing.hpp" + +#include "../regexp.hpp" + + +UNIT_TEST(RegExp_Or) +{ + regexp::RegExpT exp; + regexp::Create("\\.mwm\\.(downloading2?$|resume2?$)", exp); + + TEST(regexp::IsExist("Aruba.mwm.downloading", exp), ()); + TEST(!regexp::IsExist("Aruba.mwm.downloading1", exp), ()); + TEST(regexp::IsExist("Aruba.mwm.downloading2", exp), ()); + TEST(!regexp::IsExist("Aruba.mwm.downloading3", exp), ()); + TEST(!regexp::IsExist("Aruba.mwm.downloading.tmp", exp), ()); + + TEST(regexp::IsExist("Aruba.mwm.resume", exp), ()); + TEST(!regexp::IsExist("Aruba.mwm.resume1", exp), ()); + TEST(regexp::IsExist("Aruba.mwm.resume2", exp), ()); + TEST(!regexp::IsExist("Aruba.mwm.resume3", exp), ()); + TEST(!regexp::IsExist("Aruba.mwm.resume.tmp", exp), ()); +} |