On Mon, 22 Jan 2024 at 09:51, Jonathan Wakely <[email protected]> wrote:
>
> On Sun, 21 Jan 2024 at 22:27, Jonathan Wakely wrote:
> > --- a/libstdc++-v3/testsuite/std/time/clock/file/io.cc
> > +++ b/libstdc++-v3/testsuite/std/time/clock/file/io.cc
> > @@ -17,6 +17,23 @@ test_ostream()
> > VERIFY( ss1.str() == ss2.str() );
> > }
> >
> > +void
> > +test_format()
> > +{
> > + using namespace std::chrono;
> > + auto t = file_clock::now();
> > +
> > + auto s = std::format("{}", t);
> > + std::ostringstream ss;
> > + ss << t;
> > + VERIFY( s == ss.str() );
> > +
> > + // PR libstdc++/113500
> > + auto ft = clock_cast<file_clock>(sys_days(2024y/January/21)) + 0ms +
> > 2.5s;
> > + s = std::format("{}", ft);
> > + VERIFY( s == "2024-01-17 00:00:02.500");
>
> Well obviously that should be 2024-01-21 and I should add a call to
> test_format() in main() so it actually runs.
And I did the same in the gps/io.cc test!
I'll push this fix for that one:
--- a/libstdc++-v3/testsuite/std/time/clock/gps/io.cc
+++ b/libstdc++-v3/testsuite/std/time/clock/gps/io.cc
@@ -42,7 +42,7 @@ test_format()
// PR libstdc++/113500
s = std::format("{}", gt + 150ms + 10.5s);
- VERIFY( s == "2000-01-01 00:00:35.650" );
+ VERIFY( s == "2000-01-01 00:00:23.650" );
}
void
@@ -65,5 +65,6 @@ test_parse()
int main()
{
test_ostream();
+ test_format();
test_parse();
}