mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-16 08:04:20 +00:00
updated tests to be executed
This commit is contained in:
@@ -231,4 +231,8 @@ when isMainModule:
|
||||
except RangeError:
|
||||
discard
|
||||
|
||||
|
||||
# don't use causes integer overflow
|
||||
doAssert compiles(random[int](low(int) .. high(int)))
|
||||
|
||||
main()
|
||||
|
||||
@@ -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: '-'
|
||||
|
||||
Reference in New Issue
Block a user