Find Jobs
Hire Freelancers

a stub program for a c++/poco/regex .cpp program

$10-30 USD

Closed
Posted over 8 years ago

$10-30 USD

Paid on delivery
i have a part program that describes how "poco" can use "regex" to manipulate data, it is good because it is cross environment, but in order to do something a "stub" program must be made in order to call this routines and test the result, the routines are already there. = = = = = = = = = = = = = = = = // [login to view URL] #include <Poco/RegularExpression.h> #include <gtest/gtest.h> TEST(RegularExpressionTest, match) { Poco::RegularExpression re1("[0-9]+"); EXPECT_TRUE([login to view URL]("123")); EXPECT_FALSE([login to view URL]("abc")); EXPECT_TRUE([login to view URL]("abc123", 3)); } TEST(RegularExpressionTest, matchPos) { Poco::RegularExpression re1("[0-9]+"); Poco::RegularExpression::Match pos; EXPECT_EQ(1, [login to view URL]("123", 0, pos)); EXPECT_EQ(0, [login to view URL]); EXPECT_EQ(3, [login to view URL]); EXPECT_EQ(1, [login to view URL]("ab12de90cd12d", 0, pos)); EXPECT_EQ(2, [login to view URL]); EXPECT_EQ(2, [login to view URL]); EXPECT_EQ(0, [login to view URL]("abcd", 0, pos)); EXPECT_EQ(std::string::npos, [login to view URL]); Poco::RegularExpression re2("([0-9]+) ([0-9]+)"); Poco::RegularExpression::MatchVec posVec; EXPECT_EQ(3, [login to view URL]("123 456", 0, posVec)); EXPECT_EQ(0, posVec[0].offset); EXPECT_EQ(7, posVec[0].length); EXPECT_EQ(0, posVec[1].offset); EXPECT_EQ(3, posVec[1].length); EXPECT_EQ(4, posVec[2].offset); EXPECT_EQ(3, posVec[2].length); } TEST(RegularExpressionTest, extract) { std::string s; Poco::RegularExpression re1("[0-9]+"); Poco::RegularExpression re2("([0-9]+) ([0-9]+)"); EXPECT_EQ(1, [login to view URL]("123", s)); EXPECT_EQ("123", s); EXPECT_EQ(1, [login to view URL]("ab12de", 0, s)); EXPECT_EQ("12", s); EXPECT_EQ(0, [login to view URL]("abcd", 0, s)); EXPECT_EQ("", s); std::vector<std::string> vec; [login to view URL]("123 456", 0, vec); // FIXME: split? EXPECT_EQ("123 456", vec[0]); EXPECT_EQ("123", vec[1]); EXPECT_EQ("456", vec[2]); } TEST(RegularExpressionTest, subst) { std::string s = "123"; Poco::RegularExpression re1("[0-9]+"); Poco::RegularExpression re2("([0-9]+) ([0-9]+)"); [login to view URL](s, "ABC"); EXPECT_EQ("ABC", s); s = "123 456"; [login to view URL](s, "$2 $1"); EXPECT_EQ("456 123", s); } TEST(RegularExpressionTest, options) { Poco::RegularExpression re1("ABC"); EXPECT_FALSE([login to view URL]("abc", 0)); Poco::RegularExpression re2("ABC", Poco::RegularExpression::RE_CASELESS); EXPECT_TRUE([login to view URL]("abc", 0)); }
Project ID: 8471053

About the project

4 proposals
Remote project
Active 9 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
4 freelancers are bidding on average $31 USD for this job
User Avatar
I am very proficient in java. I have 12 years java developing experience. I have worked for 5 years, my work is online game developing, and mainly focus on server side, the language is java under linux, I am proficint in c++ also. I used java to make many great projects. For example, I made the tools which can convert PWScript(a script language created by our company) to c++ files. I made our own mobile games, and i am mainly responsible for the server side, and it was built using java. I can even show you the mobile game client. Please let expert help you.
$50 USD in 1 day
4.8 (47 reviews)
6.0
6.0
User Avatar
I have a lot of experience with regular expressions and with C++ and I think I can help you with this. Please describe what exactly do you want to be programmed for you.
$25 USD in 1 day
5.0 (3 reviews)
2.7
2.7
User Avatar
Hi,sir. I was interested when I saw your project. Because I have a lot of experiences on the fields. My skills are C, C++, Reversing, Matlab & Mathematics, Web scraping,Algorithm. I can help you very kindly. I can help you good. Best regards. Thank you.
$25 USD in 1 day
5.0 (5 reviews)
2.3
2.3
User Avatar
A proposal has not yet been provided
$25 USD in 14 days
0.0 (0 reviews)
0.0
0.0

About the client

Flag of ISRAEL
tel aviv, Israel
4.9
4
Payment method verified
Member since Jun 8, 2014

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.