mirror of
https://github.com/HowardHinnant/date.git
synced 2026-08-03 20:14:08 +02:00
Use ru{} in favor of rs{} where it makes sense
This commit is contained in:
committed by
Howard Hinnant
parent
d18e8b1653
commit
32ecb2ad24
@@ -204,6 +204,13 @@ test_c()
|
||||
assert(!in.bad());
|
||||
assert(tp == sys_days{2016_y/12/11} + hours{14} + minutes{2} + seconds{43});
|
||||
}
|
||||
{
|
||||
// can't parse negative years with "%c" directly
|
||||
std::istringstream in{"Sun Dec 11 14:02:43 -2016"};
|
||||
sys_seconds tp;
|
||||
in >> parse("%c", tp);
|
||||
assert(in.fail());
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@@ -362,6 +369,30 @@ test_d()
|
||||
assert(!in.bad());
|
||||
assert(tp == 2016_y/12/9);
|
||||
}
|
||||
{
|
||||
std::istringstream in{"2016 +9 12"};
|
||||
sys_days tp;
|
||||
in >> parse("%Y %d %m", tp);
|
||||
assert(in.fail());
|
||||
}
|
||||
{
|
||||
std::istringstream in{"2016 +9 12"};
|
||||
sys_days tp;
|
||||
in >> parse("%Y %e %m", tp);
|
||||
assert(in.fail());
|
||||
}
|
||||
{
|
||||
std::istringstream in{"2016 -9 12"};
|
||||
sys_days tp;
|
||||
in >> parse("%Y %d %m", tp);
|
||||
assert(in.fail());
|
||||
}
|
||||
{
|
||||
std::istringstream in{"2016 -9 12"};
|
||||
sys_days tp;
|
||||
in >> parse("%Y %e %m", tp);
|
||||
assert(in.fail());
|
||||
}
|
||||
{
|
||||
std::istringstream in{"2016 31 11"};
|
||||
sys_days tp;
|
||||
@@ -459,6 +490,12 @@ test_Ip()
|
||||
in >> parse("%F %I %p", tp);
|
||||
assert(in.fail());
|
||||
}
|
||||
{
|
||||
std::istringstream in{"2016-12-11 +1 pm"};
|
||||
sys_time<hours> tp;
|
||||
in >> parse("%F %I %p", tp);
|
||||
assert(in.fail());
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@@ -503,6 +540,12 @@ test_m()
|
||||
in >> parse("%Y %d %m", tp);
|
||||
assert(in.fail());
|
||||
}
|
||||
{
|
||||
std::istringstream in{"2016-12-+3"};
|
||||
sys_days tp;
|
||||
in >> parse("%Y-%d-%m", tp);
|
||||
assert(in.fail());
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@@ -776,6 +819,30 @@ test_z()
|
||||
assert(!in.bad());
|
||||
assert(tp == sys_days{2016_y/12/26} + hours{20} + minutes{53} + seconds{22});
|
||||
}
|
||||
{
|
||||
std::istringstream in{"2016-12-26 15:53:22 -+500"};
|
||||
sys_seconds tp;
|
||||
in >> parse("%F %T %z", tp);
|
||||
assert(in.fail());
|
||||
}
|
||||
{
|
||||
std::istringstream in{"2016-12-26 15:53:22 -+500"};
|
||||
sys_seconds tp;
|
||||
in >> parse("%F %T %Ez", tp);
|
||||
assert(in.fail());
|
||||
}
|
||||
{
|
||||
std::istringstream in{"2016-12-26 15:53:22 --500"};
|
||||
sys_seconds tp;
|
||||
in >> parse("%F %T %z", tp);
|
||||
assert(in.fail());
|
||||
}
|
||||
{
|
||||
std::istringstream in{"2016-12-26 15:53:22 --500"};
|
||||
sys_seconds tp;
|
||||
in >> parse("%F %T %Ez", tp);
|
||||
assert(in.fail());
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user