return StringRef(Stream.str()).contains(Error);
}
+static std::string toLower(StringRef S) {
+ std::string R;
+ R.reserve(S.size());
+ for (char C : S)
+ R += std::tolower(C);
+ return R;
+}
+
void parseExpectErrorMeta(StringRef Buf, const char *Error) {
std::string ErrorStr;
raw_string_ostream Stream(ErrorStr);
remarks::createRemarkParserFromMeta(remarks::Format::YAML, Buf);
handleAllErrors(MaybeParser.takeError(),
[&](const ErrorInfoBase &EIB) { EIB.log(Stream); });
- EXPECT_EQ(Stream.str(), Error);
+
+ // Use a case insensitive comparision due to case differences in error strings
+ // for different OSs.
+ EXPECT_EQ(toLower(Stream.str()), toLower(Error));
}
TEST(YAMLRemarks, ParsingEmpty) {