tests/ansi: Test the new strftime specifiers
@@ -14,8 +14,16 @@ int main() {
tm.tm_year = 121;
tm.tm_wday = 2;
tm.tm_yday = 39;
- strftime(timebuf, sizeof timebuf, "%e", &tm);
+ strftime(timebuf, sizeof(timebuf), "%e", &tm);
assert(!strcmp(timebuf, result));
+ memset(timebuf, 0, sizeof(timebuf));
+ strftime(timebuf, sizeof(timebuf), "%x", &tm);
+ assert(!strcmp(timebuf, "03/08/21"));
+
+ memset(timebuf, 0, sizeof(timebuf));
+ strftime(timebuf, sizeof(timebuf), "%X", &tm);
+ assert(!strcmp(timebuf, "17:17:00"));
+
return 0;
}
