diff --git a/src/tests/test-mu-date.c b/src/tests/test-mu-date.c index 1ffe509e..2ebab26c 100644 --- a/src/tests/test-mu-date.c +++ b/src/tests/test-mu-date.c @@ -129,6 +129,36 @@ test_mu_date_complete_end (void) +static void +test_mu_date_interpret_begin (void) +{ + time_t now; + now = time (NULL); + + g_assert_cmpstr (mu_date_interpret_s ("now", TRUE) , ==, + mu_date_str_s("%Y%m%d%H%M%S", now)); + + g_assert_cmpstr (mu_date_interpret_s ("today", TRUE) , ==, + mu_date_str_s("%Y%m%d000000", now)); +} + +static void +test_mu_date_interpret_end (void) +{ + time_t now; + now = time (NULL); + + g_assert_cmpstr (mu_date_interpret_s ("now", FALSE) , ==, + mu_date_str_s("%Y%m%d%H%M%S", now)); + + g_assert_cmpstr (mu_date_interpret_s ("today", FALSE) , ==, + mu_date_str_s("%Y%m%d235959", now)); +} + + + + + int main (int argc, char *argv[]) { @@ -144,6 +174,12 @@ main (int argc, char *argv[]) test_mu_date_complete_begin); g_test_add_func ("/mu-str/mu_date_complete_end", test_mu_date_complete_end); + + g_test_add_func ("/mu-str/mu_date_interpret_begin", + test_mu_date_interpret_begin); + g_test_add_func ("/mu-str/mu_date_interpret_end", + test_mu_date_interpret_end); + g_log_set_handler (NULL, G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL| G_LOG_FLAG_RECURSION,