httpdate_ut.cpp 436 B

123456789101112131415
  1. #include <library/cpp/testing/unittest/registar.h>
  2. #include "httpdate.h"
  3. Y_UNIT_TEST_SUITE(TestHttpDate) {
  4. Y_UNIT_TEST(Test1) {
  5. char buf1[100];
  6. char buf2[100];
  7. UNIT_ASSERT((int)strlen(format_http_date(0, buf1, sizeof(buf1))) == format_http_date(buf2, sizeof(buf2), 0));
  8. }
  9. Y_UNIT_TEST(Test2) {
  10. UNIT_ASSERT_STRINGS_EQUAL(FormatHttpDate(1234567890), "Fri, 13 Feb 2009 23:31:30 GMT");
  11. }
  12. }