Index: tests/OFDateTests.m ================================================================== --- tests/OFDateTests.m +++ tests/OFDateTests.m @@ -55,21 +55,28 @@ EXPECT_EXCEPTION(@"Detection of unparsed in " @"+[dateWithDateString:format:]", OFInvalidFormatException, [OFDate dateWithDateString: @"2000-06-20T12:34:56+0200x" format: @"%Y-%m-%dT%H:%M:%S%z"]) - /* - * We can only test local dates that specify a time zone, as the local - * time zone differs between systems. - */ + TEST(@"+[dateWithLocalDateString:format:]", + [[[OFDate dateWithLocalDateString: @"2000-06-20T12:34:56" + format: @"%Y-%m-%dT%H:%M:%S"] + localDateStringWithFormat: @"%Y-%m-%dT%H:%M:%S"] + isEqual: @"2000-06-20T12:34:56"]); + TEST(@"+[dateWithLocalDateString:format:]", [[[OFDate dateWithLocalDateString: @"2000-06-20T12:34:56-0200" format: @"%Y-%m-%dT%H:%M:%S%z"] description] isEqual: @"2000-06-20T14:34:56Z"]); EXPECT_EXCEPTION(@"Detection of unparsed in " - @"+[dateWithLocalDateString:format:]", OFInvalidFormatException, + @"+[dateWithLocalDateString:format:] #1", OFInvalidFormatException, + [OFDate dateWithLocalDateString: @"2000-06-20T12:34:56x" + format: @"%Y-%m-%dT%H:%M:%S"]) + + EXPECT_EXCEPTION(@"Detection of unparsed in " + @"+[dateWithLocalDateString:format:] #2", OFInvalidFormatException, [OFDate dateWithLocalDateString: @"2000-06-20T12:34:56+0200x" format: @"%Y-%m-%dT%H:%M:%S%z"]) TEST(@"-[isEqual:]", [d1 isEqual: [OFDate dateWithTimeIntervalSince1970: 0]] &&