diff options
author | Timothee Cour <timothee.cour2@gmail.com> | 2020-01-30 01:54:50 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-30 10:54:50 +0100 |
commit | bf22b44b1fff3109f637f205b7d0fca855db9bbd (patch) | |
tree | 6da9436a06959db5a41b93a336843ed35db86032 | |
parent | 81a43791f932291c0654e0a5fd6d53ede7a7c1dc (diff) | |
download | Nim-bf22b44b1fff3109f637f205b7d0fca855db9bbd.tar.gz |
miscellaneous bug fixes (#13291)
* fix for emscripten etc * add testcase for #13290 * replace deprecated isNilOrWhitespace
-rw-r--r-- | lib/pure/includes/osenv.nim | 2 | ||||
-rw-r--r-- | lib/system/timers.nim | 2 | ||||
-rw-r--r-- | testament/htmlgen.nim | 2 | ||||
-rw-r--r-- | tests/system/tsystem_misc.nim | 9 |
4 files changed, 12 insertions, 3 deletions
diff --git a/lib/pure/includes/osenv.nim b/lib/pure/includes/osenv.nim index 30904c688..c4c6669f9 100644 --- a/lib/pure/includes/osenv.nim +++ b/lib/pure/includes/osenv.nim @@ -68,7 +68,7 @@ when defined(windows) and not defined(nimscript): else: const - useNSGetEnviron = (defined(macosx) and not defined(ios)) or defined(nimscript) + useNSGetEnviron = (defined(macosx) and not defined(ios) and not defined(emscripten)) or defined(nimscript) when useNSGetEnviron: # From the manual: diff --git a/lib/system/timers.nim b/lib/system/timers.nim index 56575abb1..ffb0f7716 100644 --- a/lib/system/timers.nim +++ b/lib/system/timers.nim @@ -31,7 +31,7 @@ when defined(windows): result = Nanos(float64(a.int64 - b.int64) * performanceCounterRate) -elif defined(macosx): +elif defined(macosx) and not defined(emscripten): type MachTimebaseInfoData {.pure, final, importc: "mach_timebase_info_data_t", diff --git a/testament/htmlgen.nim b/testament/htmlgen.nim index ee3f3bad7..8e58dd95e 100644 --- a/testament/htmlgen.nim +++ b/testament/htmlgen.nim @@ -52,7 +52,7 @@ proc generateTestResultPanelPartial(outfile: File, testResultRow: JsonNode) = trId, name, target, category, action, resultDescription, timestamp, result, resultSign, panelCtxClass, textCtxClass, bgCtxClass ) - if expected.isNilOrWhitespace() and gotten.isNilOrWhitespace(): + if expected.isEmptyOrWhitespace() and gotten.isEmptyOrWhitespace(): outfile.generateHtmlTestresultOutputNone() else: outfile.generateHtmlTestresultOutputDetails( diff --git a/tests/system/tsystem_misc.nim b/tests/system/tsystem_misc.nim index 38be01a13..56af97f36 100644 --- a/tests/system/tsystem_misc.nim +++ b/tests/system/tsystem_misc.nim @@ -184,3 +184,12 @@ proc testMinMax(a,b: float32) = testMinMax(0.0, NaN) testMinMax(NaN, 0.0) + + +block: + type Foo = enum + k1, k2 + var + a = {k1} + b = {k1,k2} + doAssert a < b |