From 2a17f66792a4cbdeb6802bd5d3e4108a922a9b7a Mon Sep 17 00:00:00 2001 From: Jacob Dufault Date: Wed, 3 Jan 2018 17:30:17 -0800 Subject: [PATCH] Write test using binary, otherwise \n will become \r\n leading to double \r\r\n. --- src/utils.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils.cc b/src/utils.cc index 1381c82c..bbe9390b 100644 --- a/src/utils.cc +++ b/src/utils.cc @@ -450,7 +450,8 @@ void UpdateTestExpectation(const std::string& filename, str.replace(it, expectation.size(), actual); // Write it back out. - std::ofstream of(filename, std::ios::out | std::ios::trunc); + std::ofstream of(filename, + std::ios::out | std::ios::trunc | std::ios::binary); of.write(str.c_str(), str.size()); of.close(); }