Skip to content

Commit

Permalink
More tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JackStouffer committed Aug 8, 2016
1 parent 841a76e commit edd6aff
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions std/datetime.d
Expand Up @@ -1107,17 +1107,19 @@ public:
@safe unittest
{
assert(SysTime(0).toHash == SysTime(0).toHash);
assert(SysTime(DateTime(2000, 1, 1)).toHash == SysTime(DateTime(2000, 1, 1)).toHash);
assert(SysTime(DateTime(2000, 1, 1)).toHash != SysTime(DateTime(2000, 1, 2)).toHash);

// test that timezones aren't taken into account
assert(SysTime(0, LocalTime()).toHash == SysTime(0, LocalTime()).toHash);
assert(SysTime(0, LocalTime()).toHash == SysTime(0, UTC()).toHash);

assert(
SysTime(
DateTime(2000, 1, 1), LocalTime()
).toHash == SysTime(
DateTime(2000, 1, 1), LocalTime()
).toHash
);

immutable zone = new SimpleTimeZone(dur!"minutes"(60));
assert(
SysTime(
Expand All @@ -1128,7 +1130,7 @@ public:
);
assert(
SysTime(
DateTime(2000, 1, 1), LocalTime()
DateTime(2000, 1, 1), zone
).toHash != SysTime(
DateTime(2000, 1, 1), UTC()
).toHash
Expand Down

0 comments on commit edd6aff

Please sign in to comment.