Don't test the strtof(3) edge case on Cygwin and MinGW. Fixes #85. Change-Id: Ia5994995a763695b869cab74f9dbc85541b6f71f Reviewed-on: https://code-review.googlesource.com/4433 Reviewed-by: Paul Wankadia <junyer@google.com>
diff --git a/re2/testing/re2_test.cc b/re2/testing/re2_test.cc index 5a32d92..81d5fef 100644 --- a/re2/testing/re2_test.cc +++ b/re2/testing/re2_test.cc
@@ -879,11 +879,16 @@ // number, since C does not guarantee to get the correctly // rounded answer for strtod and strtof unless the input is // short. + // + // This is known to fail on Cygwin and MinGW due to a broken + // implementation of strtof(3). Sigh. +#if !defined(__CYGWIN__) && !defined(__MINGW32__) CHECK(RE2::FullMatch("0.1", "(.*)", &v)); CHECK_EQ(v, 0.1f) << StringPrintf("%.8g != %.8g", v, 0.1f); CHECK(RE2::FullMatch("6700000000081920.1", "(.*)", &v)); CHECK_EQ(v, 6700000000081920.1f) << StringPrintf("%.8g != %.8g", v, 6700000000081920.1f); +#endif } { double v;