Move regex constants to swipe_gesture static class member (#44)
* Move regex constants to swipe_gesture static class member * Unlink util/regex from library index
This commit is contained in:
1 parent
30e4a57b62
commit
b5c701994b
9 files changed
+20
-24
No files matched your search
@@ -2,7 +2,8 @@
|
||||
#include <cassert>
|
||||
#include <regex>
|
||||
#include <string>
|
||||
#include "../src/lib/util/regex.cpp"
|
||||
#include "../src/lib/gesture/swipe_gesture.h"
|
||||
#include "../src/lib/gesture/swipe_gesture.regex.cpp"
|
||||
|
||||
/*
|
||||
Comfortable Swipe
|
||||
@@ -59,7 +60,7 @@ namespace test
|
||||
|
||||
void gesture_begin_should_match_regex()
|
||||
{
|
||||
std::regex matcher(comfortable_swipe::util::GESTURE_SWIPE_BEGIN_REGEX_PATTERN);
|
||||
std::regex matcher(comfortable_swipe::gesture::swipe_gesture::GESTURE_BEGIN_REGEX_PATTERN);
|
||||
test::gesture_begin_test(matcher, " event15 GESTURE_SWIPE_BEGIN +34.33s 3\n", "3");
|
||||
test::gesture_begin_test(matcher, "-event4 GESTURE_SWIPE_BEGIN +3.12s 4\n", "4");
|
||||
test::gesture_begin_test(matcher, "-event7 GESTURE_SWIPE_BEGIN +4.72s 3\n", "3");
|
||||
@@ -69,7 +70,7 @@ namespace test
|
||||
void gesture_update_should_match_regex()
|
||||
{
|
||||
const char* data = " event15 GESTURE_SWIPE_UPDATE +34.70s 3 -0.12/ 4.99 (-0.33/13.50 unaccelerated)\n";
|
||||
std::regex matcher(comfortable_swipe::util::GESTURE_SWIPE_UPDATE_REGEX_PATTERN);
|
||||
std::regex matcher(comfortable_swipe::gesture::swipe_gesture::GESTURE_UPDATE_REGEX_PATTERN);
|
||||
std::cmatch matches;
|
||||
auto result = std::regex_match(data, matches, matcher);
|
||||
assert(result != 0);
|
||||
@@ -83,7 +84,7 @@ namespace test
|
||||
void gesture_end_should_match_regex()
|
||||
{
|
||||
const char* data = " event15 GESTURE_SWIPE_END +35.03s 3\n";
|
||||
std::regex matcher(comfortable_swipe::util::GESTURE_SWIPE_END_REGEX_PATTERN);
|
||||
std::regex matcher(comfortable_swipe::gesture::swipe_gesture::GESTURE_END_REGEX_PATTERN);
|
||||
std::cmatch matches;
|
||||
auto result = std::regex_match(data, matches, matcher);
|
||||
assert(result != 0);
|
||||
|
||||
Reference in new issue
Block a user