123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704 |
- --- contrib/libs/cctz/test/time_zone_format_test.cc (index)
- +++ contrib/libs/cctz/test/time_zone_format_test.cc (working tree)
- @@ -56,10 +56,10 @@ const char RFC1123_no_wday[] = "%d %b %Y %H:%M:%S %z";
- template <typename D>
- void TestFormatSpecifier(time_point<D> tp, time_zone tz, const std::string& fmt,
- const std::string& ans) {
- - EXPECT_EQ(ans, format(fmt, tp, tz)) << fmt;
- - EXPECT_EQ("xxx " + ans, format("xxx " + fmt, tp, tz));
- - EXPECT_EQ(ans + " yyy", format(fmt + " yyy", tp, tz));
- - EXPECT_EQ("xxx " + ans + " yyy", format("xxx " + fmt + " yyy", tp, tz));
- + EXPECT_EQ(ans, cctz::format(fmt, tp, tz)) << fmt;
- + EXPECT_EQ("xxx " + ans, cctz::format("xxx " + fmt, tp, tz));
- + EXPECT_EQ(ans + " yyy", cctz::format(fmt + " yyy", tp, tz));
- + EXPECT_EQ("xxx " + ans + " yyy", cctz::format("xxx " + fmt + " yyy", tp, tz));
- }
-
- } // namespace
- @@ -77,21 +77,21 @@ TEST(Format, TimePointResolution) {
- chrono::nanoseconds(789);
- EXPECT_EQ(
- "03:04:05.123456789",
- - format(kFmt, chrono::time_point_cast<chrono::nanoseconds>(t0), utc));
- + cctz::format(kFmt, chrono::time_point_cast<chrono::nanoseconds>(t0), utc));
- EXPECT_EQ(
- "03:04:05.123456",
- - format(kFmt, chrono::time_point_cast<chrono::microseconds>(t0), utc));
- + cctz::format(kFmt, chrono::time_point_cast<chrono::microseconds>(t0), utc));
- EXPECT_EQ(
- "03:04:05.123",
- - format(kFmt, chrono::time_point_cast<chrono::milliseconds>(t0), utc));
- + cctz::format(kFmt, chrono::time_point_cast<chrono::milliseconds>(t0), utc));
- EXPECT_EQ("03:04:05",
- - format(kFmt, chrono::time_point_cast<chrono::seconds>(t0), utc));
- + cctz::format(kFmt, chrono::time_point_cast<chrono::seconds>(t0), utc));
- EXPECT_EQ("03:04:05",
- - format(kFmt, chrono::time_point_cast<cctz::seconds>(t0), utc));
- + cctz::format(kFmt, chrono::time_point_cast<cctz::seconds>(t0), utc));
- EXPECT_EQ("03:04:00",
- - format(kFmt, chrono::time_point_cast<chrono::minutes>(t0), utc));
- + cctz::format(kFmt, chrono::time_point_cast<chrono::minutes>(t0), utc));
- EXPECT_EQ("03:00:00",
- - format(kFmt, chrono::time_point_cast<chrono::hours>(t0), utc));
- + cctz::format(kFmt, chrono::time_point_cast<chrono::hours>(t0), utc));
- }
-
- TEST(Format, TimePointExtendedResolution) {
- @@ -128,24 +128,24 @@ TEST(Format, Basics) {
- time_point<chrono::nanoseconds> tp = chrono::system_clock::from_time_t(0);
-
- // Starts with a couple basic edge cases.
- - EXPECT_EQ("", format("", tp, tz));
- - EXPECT_EQ(" ", format(" ", tp, tz));
- - EXPECT_EQ(" ", format(" ", tp, tz));
- - EXPECT_EQ("xxx", format("xxx", tp, tz));
- + EXPECT_EQ("", cctz::format("", tp, tz));
- + EXPECT_EQ(" ", cctz::format(" ", tp, tz));
- + EXPECT_EQ(" ", cctz::format(" ", tp, tz));
- + EXPECT_EQ("xxx", cctz::format("xxx", tp, tz));
- std::string big(128, 'x');
- - EXPECT_EQ(big, format(big, tp, tz));
- + EXPECT_EQ(big, cctz::format(big, tp, tz));
- // Cause the 1024-byte buffer to grow.
- std::string bigger(100000, 'x');
- - EXPECT_EQ(bigger, format(bigger, tp, tz));
- + EXPECT_EQ(bigger, cctz::format(bigger, tp, tz));
-
- tp += chrono::hours(13) + chrono::minutes(4) + chrono::seconds(5);
- tp += chrono::milliseconds(6) + chrono::microseconds(7) +
- chrono::nanoseconds(8);
- - EXPECT_EQ("1970-01-01", format("%Y-%m-%d", tp, tz));
- - EXPECT_EQ("13:04:05", format("%H:%M:%S", tp, tz));
- - EXPECT_EQ("13:04:05.006", format("%H:%M:%E3S", tp, tz));
- - EXPECT_EQ("13:04:05.006007", format("%H:%M:%E6S", tp, tz));
- - EXPECT_EQ("13:04:05.006007008", format("%H:%M:%E9S", tp, tz));
- + EXPECT_EQ("1970-01-01", cctz::format("%Y-%m-%d", tp, tz));
- + EXPECT_EQ("13:04:05", cctz::format("%H:%M:%S", tp, tz));
- + EXPECT_EQ("13:04:05.006", cctz::format("%H:%M:%E3S", tp, tz));
- + EXPECT_EQ("13:04:05.006007", cctz::format("%H:%M:%E6S", tp, tz));
- + EXPECT_EQ("13:04:05.006007008", cctz::format("%H:%M:%E9S", tp, tz));
- }
-
- TEST(Format, PosixConversions) {
- @@ -198,7 +198,7 @@ TEST(Format, LocaleSpecific) {
- TestFormatSpecifier(tp, tz, "%B", "January");
-
- // %c should at least produce the numeric year and time-of-day.
- - const std::string s = format("%c", tp, utc_time_zone());
- + const std::string s = cctz::format("%c", tp, utc_time_zone());
- EXPECT_THAT(s, testing::HasSubstr("1970"));
- EXPECT_THAT(s, testing::HasSubstr("00:00:00"));
-
- @@ -262,49 +262,49 @@ TEST(Format, ExtendedSeconds) {
- // No subseconds.
- time_point<chrono::nanoseconds> tp = chrono::system_clock::from_time_t(0);
- tp += chrono::seconds(5);
- - EXPECT_EQ("05", format("%E*S", tp, tz));
- - EXPECT_EQ("05", format("%E0S", tp, tz));
- - EXPECT_EQ("05.0", format("%E1S", tp, tz));
- - EXPECT_EQ("05.00", format("%E2S", tp, tz));
- - EXPECT_EQ("05.000", format("%E3S", tp, tz));
- - EXPECT_EQ("05.0000", format("%E4S", tp, tz));
- - EXPECT_EQ("05.00000", format("%E5S", tp, tz));
- - EXPECT_EQ("05.000000", format("%E6S", tp, tz));
- - EXPECT_EQ("05.0000000", format("%E7S", tp, tz));
- - EXPECT_EQ("05.00000000", format("%E8S", tp, tz));
- - EXPECT_EQ("05.000000000", format("%E9S", tp, tz));
- - EXPECT_EQ("05.0000000000", format("%E10S", tp, tz));
- - EXPECT_EQ("05.00000000000", format("%E11S", tp, tz));
- - EXPECT_EQ("05.000000000000", format("%E12S", tp, tz));
- - EXPECT_EQ("05.0000000000000", format("%E13S", tp, tz));
- - EXPECT_EQ("05.00000000000000", format("%E14S", tp, tz));
- - EXPECT_EQ("05.000000000000000", format("%E15S", tp, tz));
- + EXPECT_EQ("05", cctz::format("%E*S", tp, tz));
- + EXPECT_EQ("05", cctz::format("%E0S", tp, tz));
- + EXPECT_EQ("05.0", cctz::format("%E1S", tp, tz));
- + EXPECT_EQ("05.00", cctz::format("%E2S", tp, tz));
- + EXPECT_EQ("05.000", cctz::format("%E3S", tp, tz));
- + EXPECT_EQ("05.0000", cctz::format("%E4S", tp, tz));
- + EXPECT_EQ("05.00000", cctz::format("%E5S", tp, tz));
- + EXPECT_EQ("05.000000", cctz::format("%E6S", tp, tz));
- + EXPECT_EQ("05.0000000", cctz::format("%E7S", tp, tz));
- + EXPECT_EQ("05.00000000", cctz::format("%E8S", tp, tz));
- + EXPECT_EQ("05.000000000", cctz::format("%E9S", tp, tz));
- + EXPECT_EQ("05.0000000000", cctz::format("%E10S", tp, tz));
- + EXPECT_EQ("05.00000000000", cctz::format("%E11S", tp, tz));
- + EXPECT_EQ("05.000000000000", cctz::format("%E12S", tp, tz));
- + EXPECT_EQ("05.0000000000000", cctz::format("%E13S", tp, tz));
- + EXPECT_EQ("05.00000000000000", cctz::format("%E14S", tp, tz));
- + EXPECT_EQ("05.000000000000000", cctz::format("%E15S", tp, tz));
-
- // With subseconds.
- tp += chrono::milliseconds(6) + chrono::microseconds(7) +
- chrono::nanoseconds(8);
- - EXPECT_EQ("05.006007008", format("%E*S", tp, tz));
- - EXPECT_EQ("05", format("%E0S", tp, tz));
- - EXPECT_EQ("05.0", format("%E1S", tp, tz));
- - EXPECT_EQ("05.00", format("%E2S", tp, tz));
- - EXPECT_EQ("05.006", format("%E3S", tp, tz));
- - EXPECT_EQ("05.0060", format("%E4S", tp, tz));
- - EXPECT_EQ("05.00600", format("%E5S", tp, tz));
- - EXPECT_EQ("05.006007", format("%E6S", tp, tz));
- - EXPECT_EQ("05.0060070", format("%E7S", tp, tz));
- - EXPECT_EQ("05.00600700", format("%E8S", tp, tz));
- - EXPECT_EQ("05.006007008", format("%E9S", tp, tz));
- - EXPECT_EQ("05.0060070080", format("%E10S", tp, tz));
- - EXPECT_EQ("05.00600700800", format("%E11S", tp, tz));
- - EXPECT_EQ("05.006007008000", format("%E12S", tp, tz));
- - EXPECT_EQ("05.0060070080000", format("%E13S", tp, tz));
- - EXPECT_EQ("05.00600700800000", format("%E14S", tp, tz));
- - EXPECT_EQ("05.006007008000000", format("%E15S", tp, tz));
- + EXPECT_EQ("05.006007008", cctz::format("%E*S", tp, tz));
- + EXPECT_EQ("05", cctz::format("%E0S", tp, tz));
- + EXPECT_EQ("05.0", cctz::format("%E1S", tp, tz));
- + EXPECT_EQ("05.00", cctz::format("%E2S", tp, tz));
- + EXPECT_EQ("05.006", cctz::format("%E3S", tp, tz));
- + EXPECT_EQ("05.0060", cctz::format("%E4S", tp, tz));
- + EXPECT_EQ("05.00600", cctz::format("%E5S", tp, tz));
- + EXPECT_EQ("05.006007", cctz::format("%E6S", tp, tz));
- + EXPECT_EQ("05.0060070", cctz::format("%E7S", tp, tz));
- + EXPECT_EQ("05.00600700", cctz::format("%E8S", tp, tz));
- + EXPECT_EQ("05.006007008", cctz::format("%E9S", tp, tz));
- + EXPECT_EQ("05.0060070080", cctz::format("%E10S", tp, tz));
- + EXPECT_EQ("05.00600700800", cctz::format("%E11S", tp, tz));
- + EXPECT_EQ("05.006007008000", cctz::format("%E12S", tp, tz));
- + EXPECT_EQ("05.0060070080000", cctz::format("%E13S", tp, tz));
- + EXPECT_EQ("05.00600700800000", cctz::format("%E14S", tp, tz));
- + EXPECT_EQ("05.006007008000000", cctz::format("%E15S", tp, tz));
-
- // Times before the Unix epoch.
- tp = chrono::system_clock::from_time_t(0) + chrono::microseconds(-1);
- EXPECT_EQ("1969-12-31 23:59:59.999999",
- - format("%Y-%m-%d %H:%M:%E*S", tp, tz));
- + cctz::format("%Y-%m-%d %H:%M:%E*S", tp, tz));
-
- // Here is a "%E*S" case we got wrong for a while. While the first
- // instant below is correctly rendered as "...:07.333304", the second
- @@ -312,10 +312,10 @@ TEST(Format, ExtendedSeconds) {
- tp = chrono::system_clock::from_time_t(0) +
- chrono::microseconds(1395024427333304);
- EXPECT_EQ("2014-03-17 02:47:07.333304",
- - format("%Y-%m-%d %H:%M:%E*S", tp, tz));
- + cctz::format("%Y-%m-%d %H:%M:%E*S", tp, tz));
- tp += chrono::microseconds(1);
- EXPECT_EQ("2014-03-17 02:47:07.333305",
- - format("%Y-%m-%d %H:%M:%E*S", tp, tz));
- + cctz::format("%Y-%m-%d %H:%M:%E*S", tp, tz));
- }
-
- TEST(Format, ExtendedSubeconds) {
- @@ -324,49 +324,49 @@ TEST(Format, ExtendedSubeconds) {
- // No subseconds.
- time_point<chrono::nanoseconds> tp = chrono::system_clock::from_time_t(0);
- tp += chrono::seconds(5);
- - EXPECT_EQ("0", format("%E*f", tp, tz));
- - EXPECT_EQ("", format("%E0f", tp, tz));
- - EXPECT_EQ("0", format("%E1f", tp, tz));
- - EXPECT_EQ("00", format("%E2f", tp, tz));
- - EXPECT_EQ("000", format("%E3f", tp, tz));
- - EXPECT_EQ("0000", format("%E4f", tp, tz));
- - EXPECT_EQ("00000", format("%E5f", tp, tz));
- - EXPECT_EQ("000000", format("%E6f", tp, tz));
- - EXPECT_EQ("0000000", format("%E7f", tp, tz));
- - EXPECT_EQ("00000000", format("%E8f", tp, tz));
- - EXPECT_EQ("000000000", format("%E9f", tp, tz));
- - EXPECT_EQ("0000000000", format("%E10f", tp, tz));
- - EXPECT_EQ("00000000000", format("%E11f", tp, tz));
- - EXPECT_EQ("000000000000", format("%E12f", tp, tz));
- - EXPECT_EQ("0000000000000", format("%E13f", tp, tz));
- - EXPECT_EQ("00000000000000", format("%E14f", tp, tz));
- - EXPECT_EQ("000000000000000", format("%E15f", tp, tz));
- + EXPECT_EQ("0", cctz::format("%E*f", tp, tz));
- + EXPECT_EQ("", cctz::format("%E0f", tp, tz));
- + EXPECT_EQ("0", cctz::format("%E1f", tp, tz));
- + EXPECT_EQ("00", cctz::format("%E2f", tp, tz));
- + EXPECT_EQ("000", cctz::format("%E3f", tp, tz));
- + EXPECT_EQ("0000", cctz::format("%E4f", tp, tz));
- + EXPECT_EQ("00000", cctz::format("%E5f", tp, tz));
- + EXPECT_EQ("000000", cctz::format("%E6f", tp, tz));
- + EXPECT_EQ("0000000", cctz::format("%E7f", tp, tz));
- + EXPECT_EQ("00000000", cctz::format("%E8f", tp, tz));
- + EXPECT_EQ("000000000", cctz::format("%E9f", tp, tz));
- + EXPECT_EQ("0000000000", cctz::format("%E10f", tp, tz));
- + EXPECT_EQ("00000000000", cctz::format("%E11f", tp, tz));
- + EXPECT_EQ("000000000000", cctz::format("%E12f", tp, tz));
- + EXPECT_EQ("0000000000000", cctz::format("%E13f", tp, tz));
- + EXPECT_EQ("00000000000000", cctz::format("%E14f", tp, tz));
- + EXPECT_EQ("000000000000000", cctz::format("%E15f", tp, tz));
-
- // With subseconds.
- tp += chrono::milliseconds(6) + chrono::microseconds(7) +
- chrono::nanoseconds(8);
- - EXPECT_EQ("006007008", format("%E*f", tp, tz));
- - EXPECT_EQ("", format("%E0f", tp, tz));
- - EXPECT_EQ("0", format("%E1f", tp, tz));
- - EXPECT_EQ("00", format("%E2f", tp, tz));
- - EXPECT_EQ("006", format("%E3f", tp, tz));
- - EXPECT_EQ("0060", format("%E4f", tp, tz));
- - EXPECT_EQ("00600", format("%E5f", tp, tz));
- - EXPECT_EQ("006007", format("%E6f", tp, tz));
- - EXPECT_EQ("0060070", format("%E7f", tp, tz));
- - EXPECT_EQ("00600700", format("%E8f", tp, tz));
- - EXPECT_EQ("006007008", format("%E9f", tp, tz));
- - EXPECT_EQ("0060070080", format("%E10f", tp, tz));
- - EXPECT_EQ("00600700800", format("%E11f", tp, tz));
- - EXPECT_EQ("006007008000", format("%E12f", tp, tz));
- - EXPECT_EQ("0060070080000", format("%E13f", tp, tz));
- - EXPECT_EQ("00600700800000", format("%E14f", tp, tz));
- - EXPECT_EQ("006007008000000", format("%E15f", tp, tz));
- + EXPECT_EQ("006007008", cctz::format("%E*f", tp, tz));
- + EXPECT_EQ("", cctz::format("%E0f", tp, tz));
- + EXPECT_EQ("0", cctz::format("%E1f", tp, tz));
- + EXPECT_EQ("00", cctz::format("%E2f", tp, tz));
- + EXPECT_EQ("006", cctz::format("%E3f", tp, tz));
- + EXPECT_EQ("0060", cctz::format("%E4f", tp, tz));
- + EXPECT_EQ("00600", cctz::format("%E5f", tp, tz));
- + EXPECT_EQ("006007", cctz::format("%E6f", tp, tz));
- + EXPECT_EQ("0060070", cctz::format("%E7f", tp, tz));
- + EXPECT_EQ("00600700", cctz::format("%E8f", tp, tz));
- + EXPECT_EQ("006007008", cctz::format("%E9f", tp, tz));
- + EXPECT_EQ("0060070080", cctz::format("%E10f", tp, tz));
- + EXPECT_EQ("00600700800", cctz::format("%E11f", tp, tz));
- + EXPECT_EQ("006007008000", cctz::format("%E12f", tp, tz));
- + EXPECT_EQ("0060070080000", cctz::format("%E13f", tp, tz));
- + EXPECT_EQ("00600700800000", cctz::format("%E14f", tp, tz));
- + EXPECT_EQ("006007008000000", cctz::format("%E15f", tp, tz));
-
- // Times before the Unix epoch.
- tp = chrono::system_clock::from_time_t(0) + chrono::microseconds(-1);
- EXPECT_EQ("1969-12-31 23:59:59.999999",
- - format("%Y-%m-%d %H:%M:%S.%E*f", tp, tz));
- + cctz::format("%Y-%m-%d %H:%M:%S.%E*f", tp, tz));
-
- // Here is a "%E*S" case we got wrong for a while. While the first
- // instant below is correctly rendered as "...:07.333304", the second
- @@ -374,10 +374,10 @@ TEST(Format, ExtendedSubeconds) {
- tp = chrono::system_clock::from_time_t(0) +
- chrono::microseconds(1395024427333304);
- EXPECT_EQ("2014-03-17 02:47:07.333304",
- - format("%Y-%m-%d %H:%M:%S.%E*f", tp, tz));
- + cctz::format("%Y-%m-%d %H:%M:%S.%E*f", tp, tz));
- tp += chrono::microseconds(1);
- EXPECT_EQ("2014-03-17 02:47:07.333305",
- - format("%Y-%m-%d %H:%M:%S.%E*f", tp, tz));
- + cctz::format("%Y-%m-%d %H:%M:%S.%E*f", tp, tz));
- }
-
- TEST(Format, CompareExtendSecondsVsSubseconds) {
- @@ -393,15 +393,15 @@ TEST(Format, CompareExtendSecondsVsSubseconds) {
- time_point<chrono::nanoseconds> tp = chrono::system_clock::from_time_t(0);
- tp += chrono::seconds(5);
- // ... %E*S and %S.%E*f are different.
- - EXPECT_EQ("05", format(fmt_A("*"), tp, tz));
- - EXPECT_EQ("05.0", format(fmt_B("*"), tp, tz));
- + EXPECT_EQ("05", cctz::format(fmt_A("*"), tp, tz));
- + EXPECT_EQ("05.0", cctz::format(fmt_B("*"), tp, tz));
- // ... %E0S and %S.%E0f are different.
- - EXPECT_EQ("05", format(fmt_A("0"), tp, tz));
- - EXPECT_EQ("05.", format(fmt_B("0"), tp, tz));
- + EXPECT_EQ("05", cctz::format(fmt_A("0"), tp, tz));
- + EXPECT_EQ("05.", cctz::format(fmt_B("0"), tp, tz));
- // ... %E<prec>S and %S.%E<prec>f are the same for prec in [1:15].
- for (int prec = 1; prec <= 15; ++prec) {
- - const std::string a = format(fmt_A(std::to_string(prec)), tp, tz);
- - const std::string b = format(fmt_B(std::to_string(prec)), tp, tz);
- + const std::string a = cctz::format(fmt_A(std::to_string(prec)), tp, tz);
- + const std::string b = cctz::format(fmt_B(std::to_string(prec)), tp, tz);
- EXPECT_EQ(a, b) << "prec=" << prec;
- }
-
- @@ -409,15 +409,15 @@ TEST(Format, CompareExtendSecondsVsSubseconds) {
- // ... %E*S and %S.%E*f are the same.
- tp += chrono::milliseconds(6) + chrono::microseconds(7) +
- chrono::nanoseconds(8);
- - EXPECT_EQ("05.006007008", format(fmt_A("*"), tp, tz));
- - EXPECT_EQ("05.006007008", format(fmt_B("*"), tp, tz));
- + EXPECT_EQ("05.006007008", cctz::format(fmt_A("*"), tp, tz));
- + EXPECT_EQ("05.006007008", cctz::format(fmt_B("*"), tp, tz));
- // ... %E0S and %S.%E0f are different.
- - EXPECT_EQ("05", format(fmt_A("0"), tp, tz));
- - EXPECT_EQ("05.", format(fmt_B("0"), tp, tz));
- + EXPECT_EQ("05", cctz::format(fmt_A("0"), tp, tz));
- + EXPECT_EQ("05.", cctz::format(fmt_B("0"), tp, tz));
- // ... %E<prec>S and %S.%E<prec>f are the same for prec in [1:15].
- for (int prec = 1; prec <= 15; ++prec) {
- - const std::string a = format(fmt_A(std::to_string(prec)), tp, tz);
- - const std::string b = format(fmt_B(std::to_string(prec)), tp, tz);
- + const std::string a = cctz::format(fmt_A(std::to_string(prec)), tp, tz);
- + const std::string b = cctz::format(fmt_B(std::to_string(prec)), tp, tz);
- EXPECT_EQ(a, b) << "prec=" << prec;
- }
- }
- @@ -590,31 +590,31 @@ TEST(Format, ExtendedYears) {
-
- // %E4Y zero-pads the year to produce at least 4 chars, including the sign.
- auto tp = convert(civil_second(-999, 11, 27, 0, 0, 0), utc);
- - EXPECT_EQ("-9991127", format(e4y_fmt, tp, utc));
- + EXPECT_EQ("-9991127", cctz::format(e4y_fmt, tp, utc));
- tp = convert(civil_second(-99, 11, 27, 0, 0, 0), utc);
- - EXPECT_EQ("-0991127", format(e4y_fmt, tp, utc));
- + EXPECT_EQ("-0991127", cctz::format(e4y_fmt, tp, utc));
- tp = convert(civil_second(-9, 11, 27, 0, 0, 0), utc);
- - EXPECT_EQ("-0091127", format(e4y_fmt, tp, utc));
- + EXPECT_EQ("-0091127", cctz::format(e4y_fmt, tp, utc));
- tp = convert(civil_second(-1, 11, 27, 0, 0, 0), utc);
- - EXPECT_EQ("-0011127", format(e4y_fmt, tp, utc));
- + EXPECT_EQ("-0011127", cctz::format(e4y_fmt, tp, utc));
- tp = convert(civil_second(0, 11, 27, 0, 0, 0), utc);
- - EXPECT_EQ("00001127", format(e4y_fmt, tp, utc));
- + EXPECT_EQ("00001127", cctz::format(e4y_fmt, tp, utc));
- tp = convert(civil_second(1, 11, 27, 0, 0, 0), utc);
- - EXPECT_EQ("00011127", format(e4y_fmt, tp, utc));
- + EXPECT_EQ("00011127", cctz::format(e4y_fmt, tp, utc));
- tp = convert(civil_second(9, 11, 27, 0, 0, 0), utc);
- - EXPECT_EQ("00091127", format(e4y_fmt, tp, utc));
- + EXPECT_EQ("00091127", cctz::format(e4y_fmt, tp, utc));
- tp = convert(civil_second(99, 11, 27, 0, 0, 0), utc);
- - EXPECT_EQ("00991127", format(e4y_fmt, tp, utc));
- + EXPECT_EQ("00991127", cctz::format(e4y_fmt, tp, utc));
- tp = convert(civil_second(999, 11, 27, 0, 0, 0), utc);
- - EXPECT_EQ("09991127", format(e4y_fmt, tp, utc));
- + EXPECT_EQ("09991127", cctz::format(e4y_fmt, tp, utc));
- tp = convert(civil_second(9999, 11, 27, 0, 0, 0), utc);
- - EXPECT_EQ("99991127", format(e4y_fmt, tp, utc));
- + EXPECT_EQ("99991127", cctz::format(e4y_fmt, tp, utc));
-
- // When the year is outside [-999:9999], more than 4 chars are produced.
- tp = convert(civil_second(-1000, 11, 27, 0, 0, 0), utc);
- - EXPECT_EQ("-10001127", format(e4y_fmt, tp, utc));
- + EXPECT_EQ("-10001127", cctz::format(e4y_fmt, tp, utc));
- tp = convert(civil_second(10000, 11, 27, 0, 0, 0), utc);
- - EXPECT_EQ("100001127", format(e4y_fmt, tp, utc));
- + EXPECT_EQ("100001127", cctz::format(e4y_fmt, tp, utc));
- }
-
- TEST(Format, RFC3339Format) {
- @@ -623,45 +623,45 @@ TEST(Format, RFC3339Format) {
-
- time_point<chrono::nanoseconds> tp =
- convert(civil_second(1977, 6, 28, 9, 8, 7), tz);
- - EXPECT_EQ("1977-06-28T09:08:07-07:00", format(RFC3339_full, tp, tz));
- - EXPECT_EQ("1977-06-28T09:08:07-07:00", format(RFC3339_sec, tp, tz));
- + EXPECT_EQ("1977-06-28T09:08:07-07:00", cctz::format(RFC3339_full, tp, tz));
- + EXPECT_EQ("1977-06-28T09:08:07-07:00", cctz::format(RFC3339_sec, tp, tz));
-
- tp += chrono::milliseconds(100);
- - EXPECT_EQ("1977-06-28T09:08:07.1-07:00", format(RFC3339_full, tp, tz));
- - EXPECT_EQ("1977-06-28T09:08:07-07:00", format(RFC3339_sec, tp, tz));
- + EXPECT_EQ("1977-06-28T09:08:07.1-07:00", cctz::format(RFC3339_full, tp, tz));
- + EXPECT_EQ("1977-06-28T09:08:07-07:00", cctz::format(RFC3339_sec, tp, tz));
-
- tp += chrono::milliseconds(20);
- - EXPECT_EQ("1977-06-28T09:08:07.12-07:00", format(RFC3339_full, tp, tz));
- - EXPECT_EQ("1977-06-28T09:08:07-07:00", format(RFC3339_sec, tp, tz));
- + EXPECT_EQ("1977-06-28T09:08:07.12-07:00", cctz::format(RFC3339_full, tp, tz));
- + EXPECT_EQ("1977-06-28T09:08:07-07:00", cctz::format(RFC3339_sec, tp, tz));
-
- tp += chrono::milliseconds(3);
- - EXPECT_EQ("1977-06-28T09:08:07.123-07:00", format(RFC3339_full, tp, tz));
- - EXPECT_EQ("1977-06-28T09:08:07-07:00", format(RFC3339_sec, tp, tz));
- + EXPECT_EQ("1977-06-28T09:08:07.123-07:00", cctz::format(RFC3339_full, tp, tz));
- + EXPECT_EQ("1977-06-28T09:08:07-07:00", cctz::format(RFC3339_sec, tp, tz));
-
- tp += chrono::microseconds(400);
- - EXPECT_EQ("1977-06-28T09:08:07.1234-07:00", format(RFC3339_full, tp, tz));
- - EXPECT_EQ("1977-06-28T09:08:07-07:00", format(RFC3339_sec, tp, tz));
- + EXPECT_EQ("1977-06-28T09:08:07.1234-07:00", cctz::format(RFC3339_full, tp, tz));
- + EXPECT_EQ("1977-06-28T09:08:07-07:00", cctz::format(RFC3339_sec, tp, tz));
-
- tp += chrono::microseconds(50);
- - EXPECT_EQ("1977-06-28T09:08:07.12345-07:00", format(RFC3339_full, tp, tz));
- - EXPECT_EQ("1977-06-28T09:08:07-07:00", format(RFC3339_sec, tp, tz));
- + EXPECT_EQ("1977-06-28T09:08:07.12345-07:00", cctz::format(RFC3339_full, tp, tz));
- + EXPECT_EQ("1977-06-28T09:08:07-07:00", cctz::format(RFC3339_sec, tp, tz));
-
- tp += chrono::microseconds(6);
- - EXPECT_EQ("1977-06-28T09:08:07.123456-07:00", format(RFC3339_full, tp, tz));
- - EXPECT_EQ("1977-06-28T09:08:07-07:00", format(RFC3339_sec, tp, tz));
- + EXPECT_EQ("1977-06-28T09:08:07.123456-07:00", cctz::format(RFC3339_full, tp, tz));
- + EXPECT_EQ("1977-06-28T09:08:07-07:00", cctz::format(RFC3339_sec, tp, tz));
-
- tp += chrono::nanoseconds(700);
- - EXPECT_EQ("1977-06-28T09:08:07.1234567-07:00", format(RFC3339_full, tp, tz));
- - EXPECT_EQ("1977-06-28T09:08:07-07:00", format(RFC3339_sec, tp, tz));
- + EXPECT_EQ("1977-06-28T09:08:07.1234567-07:00", cctz::format(RFC3339_full, tp, tz));
- + EXPECT_EQ("1977-06-28T09:08:07-07:00", cctz::format(RFC3339_sec, tp, tz));
-
- tp += chrono::nanoseconds(80);
- - EXPECT_EQ("1977-06-28T09:08:07.12345678-07:00", format(RFC3339_full, tp, tz));
- - EXPECT_EQ("1977-06-28T09:08:07-07:00", format(RFC3339_sec, tp, tz));
- + EXPECT_EQ("1977-06-28T09:08:07.12345678-07:00", cctz::format(RFC3339_full, tp, tz));
- + EXPECT_EQ("1977-06-28T09:08:07-07:00", cctz::format(RFC3339_sec, tp, tz));
-
- tp += chrono::nanoseconds(9);
- EXPECT_EQ("1977-06-28T09:08:07.123456789-07:00",
- - format(RFC3339_full, tp, tz));
- - EXPECT_EQ("1977-06-28T09:08:07-07:00", format(RFC3339_sec, tp, tz));
- + cctz::format(RFC3339_full, tp, tz));
- + EXPECT_EQ("1977-06-28T09:08:07-07:00", cctz::format(RFC3339_sec, tp, tz));
- }
-
- TEST(Format, RFC1123Format) { // locale specific
- @@ -669,36 +669,36 @@ TEST(Format, RFC1123Format) { // locale specific
- EXPECT_TRUE(load_time_zone("America/Los_Angeles", &tz));
-
- auto tp = convert(civil_second(1977, 6, 28, 9, 8, 7), tz);
- - EXPECT_EQ("Tue, 28 Jun 1977 09:08:07 -0700", format(RFC1123_full, tp, tz));
- - EXPECT_EQ("28 Jun 1977 09:08:07 -0700", format(RFC1123_no_wday, tp, tz));
- + EXPECT_EQ("Tue, 28 Jun 1977 09:08:07 -0700", cctz::format(RFC1123_full, tp, tz));
- + EXPECT_EQ("28 Jun 1977 09:08:07 -0700", cctz::format(RFC1123_no_wday, tp, tz));
- }
-
- TEST(Format, Week) {
- const time_zone utc = utc_time_zone();
-
- auto tp = convert(civil_second(2017, 1, 1, 0, 0, 0), utc);
- - EXPECT_EQ("2017-01-7", format("%Y-%U-%u", tp, utc));
- - EXPECT_EQ("2017-00-0", format("%Y-%W-%w", tp, utc));
- + EXPECT_EQ("2017-01-7", cctz::format("%Y-%U-%u", tp, utc));
- + EXPECT_EQ("2017-00-0", cctz::format("%Y-%W-%w", tp, utc));
-
- tp = convert(civil_second(2017, 12, 31, 0, 0, 0), utc);
- - EXPECT_EQ("2017-53-7", format("%Y-%U-%u", tp, utc));
- - EXPECT_EQ("2017-52-0", format("%Y-%W-%w", tp, utc));
- + EXPECT_EQ("2017-53-7", cctz::format("%Y-%U-%u", tp, utc));
- + EXPECT_EQ("2017-52-0", cctz::format("%Y-%W-%w", tp, utc));
-
- tp = convert(civil_second(2018, 1, 1, 0, 0, 0), utc);
- - EXPECT_EQ("2018-00-1", format("%Y-%U-%u", tp, utc));
- - EXPECT_EQ("2018-01-1", format("%Y-%W-%w", tp, utc));
- + EXPECT_EQ("2018-00-1", cctz::format("%Y-%U-%u", tp, utc));
- + EXPECT_EQ("2018-01-1", cctz::format("%Y-%W-%w", tp, utc));
-
- tp = convert(civil_second(2018, 12, 31, 0, 0, 0), utc);
- - EXPECT_EQ("2018-52-1", format("%Y-%U-%u", tp, utc));
- - EXPECT_EQ("2018-53-1", format("%Y-%W-%w", tp, utc));
- + EXPECT_EQ("2018-52-1", cctz::format("%Y-%U-%u", tp, utc));
- + EXPECT_EQ("2018-53-1", cctz::format("%Y-%W-%w", tp, utc));
-
- tp = convert(civil_second(2019, 1, 1, 0, 0, 0), utc);
- - EXPECT_EQ("2019-00-2", format("%Y-%U-%u", tp, utc));
- - EXPECT_EQ("2019-00-2", format("%Y-%W-%w", tp, utc));
- + EXPECT_EQ("2019-00-2", cctz::format("%Y-%U-%u", tp, utc));
- + EXPECT_EQ("2019-00-2", cctz::format("%Y-%W-%w", tp, utc));
-
- tp = convert(civil_second(2019, 12, 31, 0, 0, 0), utc);
- - EXPECT_EQ("2019-52-2", format("%Y-%U-%u", tp, utc));
- - EXPECT_EQ("2019-52-2", format("%Y-%W-%w", tp, utc));
- + EXPECT_EQ("2019-52-2", cctz::format("%Y-%U-%u", tp, utc));
- + EXPECT_EQ("2019-52-2", cctz::format("%Y-%W-%w", tp, utc));
- }
-
- //
- @@ -711,39 +711,39 @@ TEST(Parse, TimePointResolution) {
-
- time_point<chrono::nanoseconds> tp_ns;
- EXPECT_TRUE(parse(kFmt, "03:04:05.123456789", utc, &tp_ns));
- - EXPECT_EQ("03:04:05.123456789", format(kFmt, tp_ns, utc));
- + EXPECT_EQ("03:04:05.123456789", cctz::format(kFmt, tp_ns, utc));
- EXPECT_TRUE(parse(kFmt, "03:04:05.123456", utc, &tp_ns));
- - EXPECT_EQ("03:04:05.123456", format(kFmt, tp_ns, utc));
- + EXPECT_EQ("03:04:05.123456", cctz::format(kFmt, tp_ns, utc));
-
- time_point<chrono::microseconds> tp_us;
- EXPECT_TRUE(parse(kFmt, "03:04:05.123456789", utc, &tp_us));
- - EXPECT_EQ("03:04:05.123456", format(kFmt, tp_us, utc));
- + EXPECT_EQ("03:04:05.123456", cctz::format(kFmt, tp_us, utc));
- EXPECT_TRUE(parse(kFmt, "03:04:05.123456", utc, &tp_us));
- - EXPECT_EQ("03:04:05.123456", format(kFmt, tp_us, utc));
- + EXPECT_EQ("03:04:05.123456", cctz::format(kFmt, tp_us, utc));
- EXPECT_TRUE(parse(kFmt, "03:04:05.123", utc, &tp_us));
- - EXPECT_EQ("03:04:05.123", format(kFmt, tp_us, utc));
- + EXPECT_EQ("03:04:05.123", cctz::format(kFmt, tp_us, utc));
-
- time_point<chrono::milliseconds> tp_ms;
- EXPECT_TRUE(parse(kFmt, "03:04:05.123456", utc, &tp_ms));
- - EXPECT_EQ("03:04:05.123", format(kFmt, tp_ms, utc));
- + EXPECT_EQ("03:04:05.123", cctz::format(kFmt, tp_ms, utc));
- EXPECT_TRUE(parse(kFmt, "03:04:05.123", utc, &tp_ms));
- - EXPECT_EQ("03:04:05.123", format(kFmt, tp_ms, utc));
- + EXPECT_EQ("03:04:05.123", cctz::format(kFmt, tp_ms, utc));
- EXPECT_TRUE(parse(kFmt, "03:04:05", utc, &tp_ms));
- - EXPECT_EQ("03:04:05", format(kFmt, tp_ms, utc));
- + EXPECT_EQ("03:04:05", cctz::format(kFmt, tp_ms, utc));
-
- time_point<chrono::seconds> tp_s;
- EXPECT_TRUE(parse(kFmt, "03:04:05.123", utc, &tp_s));
- - EXPECT_EQ("03:04:05", format(kFmt, tp_s, utc));
- + EXPECT_EQ("03:04:05", cctz::format(kFmt, tp_s, utc));
- EXPECT_TRUE(parse(kFmt, "03:04:05", utc, &tp_s));
- - EXPECT_EQ("03:04:05", format(kFmt, tp_s, utc));
- + EXPECT_EQ("03:04:05", cctz::format(kFmt, tp_s, utc));
-
- time_point<chrono::minutes> tp_m;
- EXPECT_TRUE(parse(kFmt, "03:04:05", utc, &tp_m));
- - EXPECT_EQ("03:04:00", format(kFmt, tp_m, utc));
- + EXPECT_EQ("03:04:00", cctz::format(kFmt, tp_m, utc));
-
- time_point<chrono::hours> tp_h;
- EXPECT_TRUE(parse(kFmt, "03:04:05", utc, &tp_h));
- - EXPECT_EQ("03:00:00", format(kFmt, tp_h, utc));
- + EXPECT_EQ("03:00:00", cctz::format(kFmt, tp_h, utc));
- }
-
- TEST(Parse, TimePointExtendedResolution) {
- @@ -1538,7 +1538,7 @@ TEST(FormatParse, RoundTrip) {
- // RFC3339, which renders subseconds.
- {
- time_point<chrono::nanoseconds> out;
- - const std::string s = format(RFC3339_full, in + subseconds, lax);
- + const std::string s = cctz::format(RFC3339_full, in + subseconds, lax);
- EXPECT_TRUE(parse(RFC3339_full, s, lax, &out)) << s;
- EXPECT_EQ(in + subseconds, out); // RFC3339_full includes %Ez
- }
- @@ -1546,7 +1546,7 @@ TEST(FormatParse, RoundTrip) {
- // RFC1123, which only does whole seconds.
- {
- time_point<chrono::nanoseconds> out;
- - const std::string s = format(RFC1123_full, in, lax);
- + const std::string s = cctz::format(RFC1123_full, in, lax);
- EXPECT_TRUE(parse(RFC1123_full, s, lax, &out)) << s;
- EXPECT_EQ(in, out); // RFC1123_full includes %z
- }
- @@ -1560,7 +1560,7 @@ TEST(FormatParse, RoundTrip) {
- {
- time_point<chrono::nanoseconds> out;
- time_zone utc = utc_time_zone();
- - const std::string s = format("%c", in, utc);
- + const std::string s = cctz::format("%c", in, utc);
- EXPECT_TRUE(parse("%c", s, utc, &out)) << s;
- EXPECT_EQ(in, out);
- }
- @@ -1570,7 +1570,7 @@ TEST(FormatParse, RoundTrip) {
- TEST(FormatParse, RoundTripDistantFuture) {
- const time_zone utc = utc_time_zone();
- const time_point<cctz::seconds> in = time_point<cctz::seconds>::max();
- - const std::string s = format(RFC3339_full, in, utc);
- + const std::string s = cctz::format(RFC3339_full, in, utc);
- time_point<cctz::seconds> out;
- EXPECT_TRUE(parse(RFC3339_full, s, utc, &out)) << s;
- EXPECT_EQ(in, out);
- @@ -1579,7 +1579,7 @@ TEST(FormatParse, RoundTripDistantFuture) {
- TEST(FormatParse, RoundTripDistantPast) {
- const time_zone utc = utc_time_zone();
- const time_point<cctz::seconds> in = time_point<cctz::seconds>::min();
- - const std::string s = format(RFC3339_full, in, utc);
- + const std::string s = cctz::format(RFC3339_full, in, utc);
- time_point<cctz::seconds> out;
- EXPECT_TRUE(parse(RFC3339_full, s, utc, &out)) << s;
- EXPECT_EQ(in, out);
- --- contrib/libs/cctz/test/time_zone_lookup_test.cc (index)
- +++ contrib/libs/cctz/test/time_zone_lookup_test.cc (working tree)
- @@ -899,19 +899,19 @@ TEST(MakeTime, TimePointResolution) {
- const time_zone utc = utc_time_zone();
- const time_point<chrono::nanoseconds> tp_ns =
- convert(civil_second(2015, 1, 2, 3, 4, 5), utc);
- - EXPECT_EQ("04:05", format("%M:%E*S", tp_ns, utc));
- + EXPECT_EQ("04:05", cctz::format("%M:%E*S", tp_ns, utc));
- const time_point<chrono::microseconds> tp_us =
- convert(civil_second(2015, 1, 2, 3, 4, 5), utc);
- - EXPECT_EQ("04:05", format("%M:%E*S", tp_us, utc));
- + EXPECT_EQ("04:05", cctz::format("%M:%E*S", tp_us, utc));
- const time_point<chrono::milliseconds> tp_ms =
- convert(civil_second(2015, 1, 2, 3, 4, 5), utc);
- - EXPECT_EQ("04:05", format("%M:%E*S", tp_ms, utc));
- + EXPECT_EQ("04:05", cctz::format("%M:%E*S", tp_ms, utc));
- const time_point<chrono::seconds> tp_s =
- convert(civil_second(2015, 1, 2, 3, 4, 5), utc);
- - EXPECT_EQ("04:05", format("%M:%E*S", tp_s, utc));
- + EXPECT_EQ("04:05", cctz::format("%M:%E*S", tp_s, utc));
- const time_point<cctz::seconds> tp_s64 =
- convert(civil_second(2015, 1, 2, 3, 4, 5), utc);
- - EXPECT_EQ("04:05", format("%M:%E*S", tp_s64, utc));
- + EXPECT_EQ("04:05", cctz::format("%M:%E*S", tp_s64, utc));
-
- // These next two require chrono::time_point_cast because the conversion
- // from a resolution of seconds (the return value of convert()) to a
- @@ -919,11 +919,11 @@ TEST(MakeTime, TimePointResolution) {
- const time_point<chrono::minutes> tp_m =
- chrono::time_point_cast<chrono::minutes>(
- convert(civil_second(2015, 1, 2, 3, 4, 5), utc));
- - EXPECT_EQ("04:00", format("%M:%E*S", tp_m, utc));
- + EXPECT_EQ("04:00", cctz::format("%M:%E*S", tp_m, utc));
- const time_point<chrono::hours> tp_h =
- chrono::time_point_cast<chrono::hours>(
- convert(civil_second(2015, 1, 2, 3, 4, 5), utc));
- - EXPECT_EQ("00:00", format("%M:%E*S", tp_h, utc));
- + EXPECT_EQ("00:00", cctz::format("%M:%E*S", tp_h, utc));
- }
-
- TEST(MakeTime, Normalization) {
- @@ -949,9 +949,9 @@ TEST(MakeTime, SysSecondsLimits) {
-
- // Approach the maximal time_point<cctz::seconds> value from below.
- tp = convert(civil_second(292277026596, 12, 4, 15, 30, 6), utc);
- - EXPECT_EQ("292277026596-12-04T15:30:06+00:00", format(RFC3339, tp, utc));
- + EXPECT_EQ("292277026596-12-04T15:30:06+00:00", cctz::format(RFC3339, tp, utc));
- tp = convert(civil_second(292277026596, 12, 4, 15, 30, 7), utc);
- - EXPECT_EQ("292277026596-12-04T15:30:07+00:00", format(RFC3339, tp, utc));
- + EXPECT_EQ("292277026596-12-04T15:30:07+00:00", cctz::format(RFC3339, tp, utc));
- EXPECT_EQ(time_point<cctz::seconds>::max(), tp);
- tp = convert(civil_second(292277026596, 12, 4, 15, 30, 8), utc);
- EXPECT_EQ(time_point<cctz::seconds>::max(), tp);
- @@ -960,7 +960,7 @@ TEST(MakeTime, SysSecondsLimits) {
-
- // Checks that we can also get the maximal value for a far-east zone.
- tp = convert(civil_second(292277026596, 12, 5, 5, 30, 7), east);
- - EXPECT_EQ("292277026596-12-05T05:30:07+14:00", format(RFC3339, tp, east));
- + EXPECT_EQ("292277026596-12-05T05:30:07+14:00", cctz::format(RFC3339, tp, east));
- EXPECT_EQ(time_point<cctz::seconds>::max(), tp);
- tp = convert(civil_second(292277026596, 12, 5, 5, 30, 8), east);
- EXPECT_EQ(time_point<cctz::seconds>::max(), tp);
- @@ -969,7 +969,7 @@ TEST(MakeTime, SysSecondsLimits) {
-
- // Checks that we can also get the maximal value for a far-west zone.
- tp = convert(civil_second(292277026596, 12, 4, 1, 30, 7), west);
- - EXPECT_EQ("292277026596-12-04T01:30:07-14:00", format(RFC3339, tp, west));
- + EXPECT_EQ("292277026596-12-04T01:30:07-14:00", cctz::format(RFC3339, tp, west));
- EXPECT_EQ(time_point<cctz::seconds>::max(), tp);
- tp = convert(civil_second(292277026596, 12, 4, 7, 30, 8), west);
- EXPECT_EQ(time_point<cctz::seconds>::max(), tp);
- @@ -978,9 +978,9 @@ TEST(MakeTime, SysSecondsLimits) {
-
- // Approach the minimal time_point<cctz::seconds> value from above.
- tp = convert(civil_second(-292277022657, 1, 27, 8, 29, 53), utc);
- - EXPECT_EQ("-292277022657-01-27T08:29:53+00:00", format(RFC3339, tp, utc));
- + EXPECT_EQ("-292277022657-01-27T08:29:53+00:00", cctz::format(RFC3339, tp, utc));
- tp = convert(civil_second(-292277022657, 1, 27, 8, 29, 52), utc);
- - EXPECT_EQ("-292277022657-01-27T08:29:52+00:00", format(RFC3339, tp, utc));
- + EXPECT_EQ("-292277022657-01-27T08:29:52+00:00", cctz::format(RFC3339, tp, utc));
- EXPECT_EQ(time_point<cctz::seconds>::min(), tp);
- tp = convert(civil_second(-292277022657, 1, 27, 8, 29, 51), utc);
- EXPECT_EQ(time_point<cctz::seconds>::min(), tp);
- @@ -989,7 +989,7 @@ TEST(MakeTime, SysSecondsLimits) {
-
- // Checks that we can also get the minimal value for a far-east zone.
- tp = convert(civil_second(-292277022657, 1, 27, 22, 29, 52), east);
- - EXPECT_EQ("-292277022657-01-27T22:29:52+14:00", format(RFC3339, tp, east));
- + EXPECT_EQ("-292277022657-01-27T22:29:52+14:00", cctz::format(RFC3339, tp, east));
- EXPECT_EQ(time_point<cctz::seconds>::min(), tp);
- tp = convert(civil_second(-292277022657, 1, 27, 22, 29, 51), east);
- EXPECT_EQ(time_point<cctz::seconds>::min(), tp);
- @@ -998,7 +998,7 @@ TEST(MakeTime, SysSecondsLimits) {
-
- // Checks that we can also get the minimal value for a far-west zone.
- tp = convert(civil_second(-292277022657, 1, 26, 18, 29, 52), west);
- - EXPECT_EQ("-292277022657-01-26T18:29:52-14:00", format(RFC3339, tp, west));
- + EXPECT_EQ("-292277022657-01-26T18:29:52-14:00", cctz::format(RFC3339, tp, west));
- EXPECT_EQ(time_point<cctz::seconds>::min(), tp);
- tp = convert(civil_second(-292277022657, 1, 26, 18, 29, 51), west);
- EXPECT_EQ(time_point<cctz::seconds>::min(), tp);
- @@ -1018,11 +1018,11 @@ TEST(MakeTime, SysSecondsLimits) {
- #if defined(__FreeBSD__) || defined(__OpenBSD__)
- // The BSD gmtime_r() fails on extreme positive tm_year values.
- #else
- - EXPECT_EQ("2147485547-12-31T23:59:59+00:00", format(RFC3339, tp, cut));
- + EXPECT_EQ("2147485547-12-31T23:59:59+00:00", cctz::format(RFC3339, tp, cut));
- #endif
- const year_t min_tm_year = year_t{std::numeric_limits<int>::min()} + 1900;
- tp = convert(civil_second(min_tm_year, 1, 1, 0, 0, 0), cut);
- - EXPECT_EQ("-2147481748-01-01T00:00:00+00:00", format(RFC3339, tp, cut));
- + EXPECT_EQ("-2147481748-01-01T00:00:00+00:00", cctz::format(RFC3339, tp, cut));
- #endif
- }
- }
|