Set minimum days in first week so we number weeks in December 2012 from 0

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@36398 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2013-03-22 16:26:42 +00:00
parent 5db83d1282
commit cb1874874d

View file

@ -22,14 +22,16 @@ int main()
if (!NSCALENDAR_SUPPORTED)
SKIP("NSCalendar not supported\nThe ICU library was not available when GNUstep-base was built")
cal = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
cal = [[NSCalendar alloc] initWithCalendarIdentifier: NSGregorianCalendar];
[cal setMinimumDaysInFirstWeek: 4];
[cal setFirstWeekday: 1];
date = [NSDate dateWithString: @"2012-12-31 13:57:00 +0100"];
comps = [cal components: NSYearForWeekOfYearCalendarUnit
| NSWeekOfYearCalendarUnit | NSWeekOfMonthCalendarUnit
fromDate: date];
PASS([comps weekOfMonth] == 5, "-weekOfMonth returns the correct week");
PASS([comps weekOfYear] == 1, "-weekOfYear returns the correct week");
PASS([comps yearForWeekOfYear] == 2013,