approvals / ApprovalTests.cpp

Native ApprovalTests for C++ on Linux, Mac and Windows
https://approvaltestscpp.readthedocs.io/en/latest/
Apache License 2.0
312 stars 51 forks source link

Test failure in DateTimeScrubbingSamples.cpp on mingw in AppVeyor #151

Closed claremacrae closed 3 years ago

claremacrae commented 3 years ago

With the format "%a %b %e %T %G", DateUtils::toString(dateTime, format) is returning a much-too-short string:

Thu Aug (possibly with an extra space after it)

Example failing test: https://ci.appveyor.com/project/isidore/approvaltests-cpp/builds/34515858/job/a6m0w24md11pq54n

claremacrae commented 3 years ago

The received file for this failing test is this - where each of the _ is a space:

date: Fri Aug___

claremacrae commented 3 years ago

There are known problems with not all C++11 format strings being supported on mingw.

See http://www.cplusplus.com/forum/beginner/170947/#msg852121

The test was using:

"%a %b %e %T %G"

Changing to this fixed it:

"%a %b %d %H:%M:%S %Y"

claremacrae commented 3 years ago

Confirmed that this is now fixed.