]>
git.proxmox.com Git - libgit2.git/blob - tests/libgit2/date/rfc2822.c
1 #include "clar_libgit2.h"
5 void test_date_rfc2822__format_rfc2822_no_offset(void)
7 git_time t
= {1397031663, 0};
8 git_str buf
= GIT_STR_INIT
;
10 cl_git_pass(git_date_rfc2822_fmt(&buf
, t
.time
, t
.offset
));
11 cl_assert_equal_s("Wed, 9 Apr 2014 08:21:03 +0000", buf
.ptr
);
13 git_str_dispose(&buf
);
16 void test_date_rfc2822__format_rfc2822_positive_offset(void)
18 git_time t
= {1397031663, 120};
19 git_str buf
= GIT_STR_INIT
;
21 cl_git_pass(git_date_rfc2822_fmt(&buf
, t
.time
, t
.offset
));
22 cl_assert_equal_s("Wed, 9 Apr 2014 10:21:03 +0200", buf
.ptr
);
24 git_str_dispose(&buf
);
27 void test_date_rfc2822__format_rfc2822_negative_offset(void)
29 git_time t
= {1397031663, -120};
30 git_str buf
= GIT_STR_INIT
;
32 cl_git_pass(git_date_rfc2822_fmt(&buf
, t
.time
, t
.offset
));
33 cl_assert_equal_s("Wed, 9 Apr 2014 06:21:03 -0200", buf
.ptr
);
35 git_str_dispose(&buf
);