Make explicit char * -> string conversion in test helper

The version of clang on travis-ci seems to not allow this
conversion to be made implicitly
This commit is contained in:
Max Brunsfeld 2014-03-22 16:01:40 -07:00
parent 13009e52a5
commit 57ed6da225

View file

@ -15,17 +15,16 @@ using std::regex_replace;
static string trim_output(const string &input) {
string result(input);
result = regex_replace(result, regex("^[\\s]+"), "");
result = regex_replace(result, regex("[\\s]+$"), "");
result = regex_replace(result, regex("\\)\\s+\\)"), "))");
result = regex_replace(result, regex("\\s+"), " ");
result = regex_replace(result, regex("[\n\t ]+", std::regex_constants::extended), string(" "));
result = regex_replace(result, regex("^ ", std::regex_constants::extended), string(""));
result = regex_replace(result, regex(" $", std::regex_constants::extended), string(""));
result = regex_replace(result, regex("\\) \\)", std::regex_constants::extended), string("))"));
return result;
}
static vector<TestEntry> get_test_entries_from_string(string content) {
regex header_pattern("===+\n" "([^=]+)\n" "===+\n");
regex separator_pattern("---+");
regex header_pattern("===+\n" "([^=]+)\n" "===+", std::regex_constants::extended);
regex separator_pattern("---+", std::regex_constants::extended);
vector<string> descriptions;
vector<string> bodies;