diff options
author | Arne Döring <arne.doering@gmx.net> | 2018-11-14 23:14:16 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2018-11-23 11:58:28 +0100 |
commit | e012eb100109d343b7cdbe2598d439d84eda7830 (patch) | |
tree | ec977218e469415b04cc7005473f9f3358dcd553 /lib | |
parent | 8ea72bdceab5a13318a0269bb44990e514bf03a7 (diff) | |
download | Nim-e012eb100109d343b7cdbe2598d439d84eda7830.tar.gz |
updated tests to be executed
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pure/random.nim | 4 | ||||
-rw-r--r-- | lib/pure/times.nim | 7 |
2 files changed, 10 insertions, 1 deletions
diff --git a/lib/pure/random.nim b/lib/pure/random.nim index a2c2c1f88..c458d51eb 100644 --- a/lib/pure/random.nim +++ b/lib/pure/random.nim @@ -231,4 +231,8 @@ when isMainModule: except RangeError: discard + + # don't use causes integer overflow + doAssert compiles(random[int](low(int) .. high(int))) + main() diff --git a/lib/pure/times.nim b/lib/pure/times.nim index ef329502f..fd1a6acc5 100644 --- a/lib/pure/times.nim +++ b/lib/pure/times.nim @@ -839,6 +839,11 @@ proc `$`*(zone: Timezone): string = proc `==`*(zone1, zone2: Timezone): bool = ## Two ``Timezone``'s are considered equal if their name is equal. + if system.`==`(zone1, zone2): + return true + if zone1.isNil or zone2.isNil: + return false + runnableExamples: doAssert local() == local() doAssert local() != utc() @@ -1799,7 +1804,7 @@ proc formatPattern(dt: DateTime, pattern: FormatPattern, result: var string) = of UUUU: result.add $dt.year of z, zz, zzz, zzzz: - if dt.timezone.name == "Etc/UTC": + if dt.timezone != nil and dt.timezone.name == "Etc/UTC": result.add 'Z' else: result.add if -dt.utcOffset >= 0: '+' else: '-' |