Add unittest to IXSentryClient to lua backtrace parsing code

This commit is contained in:
Benjamin Sergeant
2019-10-26 10:54:47 -07:00
parent 0e73fe51e9
commit 6904dd3f4c
5 changed files with 25 additions and 11 deletions

View File

@ -17,7 +17,7 @@ namespace ix
SentryClient::SentryClient(const std::string& dsn)
: _dsn(dsn)
, _validDsn(false)
, _luaFrameRegex("\t([^/]+):([0-9]+): in function '([^/]+)'")
, _luaFrameRegex("\t([^/]+):([0-9]+): in function ['<]([^/]+)['>]")
{
const std::regex dsnRegex("(http[s]?)://([^:]+):([^@]+)@([^/]+)/([0-9]+)");
std::smatch group;

View File

@ -21,14 +21,14 @@ namespace ix
std::pair<HttpResponsePtr, std::string> send(const Json::Value& msg, bool verbose);
Json::Value parseLuaStackTrace(const std::string& stack);
private:
int64_t getTimestamp();
std::string computeAuthHeader();
std::string getIso8601();
std::string computePayload(const Json::Value& msg);
Json::Value parseLuaStackTrace(const std::string& stack);
std::string _dsn;
bool _validDsn;
std::string _url;