~ubuntu-branches/debian/squeeze/tasks/squeeze

« back to all changes in this revision

Viewing changes to libkoto/test-ical-util.c

  • Committer: Bazaar Package Importer
  • Author(s): Ross Burton
  • Date: 2008-09-29 10:24:11 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20080929102411-vv4quqpp2m0ppl3q
Tags: 0.14-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
  g_date_clear (&date, 1);
20
20
  
21
21
  g_date_set_dmy (&date, 1, G_DATE_MAY, 2001);
22
 
  s = ical_util_get_human_date (&date);
23
 
  g_assert (strcmp (s, "05/01/01") == 0);
 
22
  s = ical_util_get_human_due_date (&date);
 
23
  g_assert (strcmp (s, "due 05/01/01") == 0);
24
24
 
25
25
  g_date_set_time_t (&date, time (NULL));
26
 
  s = ical_util_get_human_date (&date);
27
 
  g_assert (strcmp (s, "today") == 0);
 
26
  s = ical_util_get_human_due_date (&date);
 
27
  g_assert (strcmp (s, "due today") == 0);
28
28
 
29
29
  g_date_add_days (&date, 1);
30
 
  s = ical_util_get_human_date (&date);
31
 
  g_assert (strcmp (s, "tomorrow") == 0);
 
30
  s = ical_util_get_human_due_date (&date);
 
31
  g_assert (strcmp (s, "due tomorrow") == 0);
32
32
 
33
33
  g_date_subtract_days (&date, 2);
34
 
  s = ical_util_get_human_date (&date);
35
 
  g_assert (strcmp (s, "yesterday") == 0);
 
34
  s = ical_util_get_human_due_date (&date);
 
35
  g_assert (strcmp (s, "due yesterday") == 0);
36
36
 
37
37
  g_date_add_days (&date, 3);
38
 
  s = ical_util_get_human_date (&date);
39
 
  g_assert (strcmp (s, weekdays[g_date_get_weekday (&date)]) == 0);
 
38
  s = ical_util_get_human_due_date (&date);
 
39
  g_assert (strcmp (s, g_strdup_printf ("due %s", weekdays[g_date_get_weekday (&date)])) == 0);
40
40
 
41
41
  return 0;
42
42
}