Differences From Artifact [e0e02d2def]:
- File
tests/OFDateTests.m
— part of check-in
[dc0c6c34ab]
at
2019-02-17 22:44:23
on branch trunk
— tests: Only import ObjFW.h
This prevents forgetting to add an import to ObjFW.h, as the tests would
then not compile. (user: js, size: 3414) [annotate] [blame] [check-ins using]
To Artifact [db640ccf02]:
- File tests/OFDateTests.m — part of check-in [b045cbb9c7] at 2019-03-25 00:21:30 on branch trunk — tests: Use dot syntax (user: js, size: 3369) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
40 41 42 43 44 45 46 | TEST(@"+[dateWithTimeIntervalSince1970:]", (d1 = [OFDate dateWithTimeIntervalSince1970: 0])) TEST(@"-[dateByAddingTimeInterval:]", (d2 = [d1 dateByAddingTimeInterval: 3600 * 25 + 5.000002])) TEST(@"-[description]", | | | | 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | TEST(@"+[dateWithTimeIntervalSince1970:]", (d1 = [OFDate dateWithTimeIntervalSince1970: 0])) TEST(@"-[dateByAddingTimeInterval:]", (d2 = [d1 dateByAddingTimeInterval: 3600 * 25 + 5.000002])) TEST(@"-[description]", [d1.description isEqual: @"1970-01-01T00:00:00Z"] && [d2.description isEqual: @"1970-01-02T01:00:05Z"]) TEST(@"+[dateWithDateString:format:]", [[[OFDate dateWithDateString: @"2000-06-20T12:34:56+0200" format: @"%Y-%m-%dT%H:%M:%S%z"] description] isEqual: @"2000-06-20T10:34:56Z"]); EXPECT_EXCEPTION(@"Detection of unparsed in " |
︙ | ︙ | |||
73 74 75 76 77 78 79 | TEST(@"-[isEqual:]", [d1 isEqual: [OFDate dateWithTimeIntervalSince1970: 0]] && ![d1 isEqual: [OFDate dateWithTimeIntervalSince1970: 0.0000001]]) TEST(@"-[compare:]", [d1 compare: d2] == OF_ORDERED_ASCENDING) | | | < | | | | | | | | 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 | TEST(@"-[isEqual:]", [d1 isEqual: [OFDate dateWithTimeIntervalSince1970: 0]] && ![d1 isEqual: [OFDate dateWithTimeIntervalSince1970: 0.0000001]]) TEST(@"-[compare:]", [d1 compare: d2] == OF_ORDERED_ASCENDING) TEST(@"-[second]", d1.second == 0 && d2.second == 5) TEST(@"-[microsecond]", d1.microsecond == 0 && d2.microsecond == 2) TEST(@"-[minute]", d1.minute == 0 && d2.minute == 0) TEST(@"-[hour]", d1.hour == 0 && d2.hour == 1) TEST(@"-[dayOfMonth]", d1.dayOfMonth == 1 && d2.dayOfMonth == 2) TEST(@"-[monthOfYear]", d1.monthOfYear == 1 && d2.monthOfYear == 1) TEST(@"-[year]", d1.year == 1970 && d2.year == 1970) TEST(@"-[dayOfWeek]", d1.dayOfWeek == 4 && d2.dayOfWeek == 5) TEST(@"-[dayOfYear]", d1.dayOfYear == 1 && d2.dayOfYear == 2) TEST(@"-[earlierDate:]", [[d1 earlierDate: d2] isEqual: d1]) TEST(@"-[laterDate:]", [[d1 laterDate: d2] isEqual: d2]) [pool drain]; } @end |