miscellaneous bug fixes (#13291)
* fix for emscripten etc * add testcase for #13290 * replace deprecated isNilOrWhitespace
This commit is contained in:
parent
81a43791f9
commit
bf22b44b1f
4 changed files with 12 additions and 3 deletions
|
|
@ -68,7 +68,7 @@ when defined(windows) and not defined(nimscript):
|
||||||
|
|
||||||
else:
|
else:
|
||||||
const
|
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:
|
when useNSGetEnviron:
|
||||||
# From the manual:
|
# From the manual:
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ when defined(windows):
|
||||||
|
|
||||||
result = Nanos(float64(a.int64 - b.int64) * performanceCounterRate)
|
result = Nanos(float64(a.int64 - b.int64) * performanceCounterRate)
|
||||||
|
|
||||||
elif defined(macosx):
|
elif defined(macosx) and not defined(emscripten):
|
||||||
type
|
type
|
||||||
MachTimebaseInfoData {.pure, final,
|
MachTimebaseInfoData {.pure, final,
|
||||||
importc: "mach_timebase_info_data_t",
|
importc: "mach_timebase_info_data_t",
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ proc generateTestResultPanelPartial(outfile: File, testResultRow: JsonNode) =
|
||||||
trId, name, target, category, action, resultDescription,
|
trId, name, target, category, action, resultDescription,
|
||||||
timestamp, result, resultSign, panelCtxClass, textCtxClass, bgCtxClass
|
timestamp, result, resultSign, panelCtxClass, textCtxClass, bgCtxClass
|
||||||
)
|
)
|
||||||
if expected.isNilOrWhitespace() and gotten.isNilOrWhitespace():
|
if expected.isEmptyOrWhitespace() and gotten.isEmptyOrWhitespace():
|
||||||
outfile.generateHtmlTestresultOutputNone()
|
outfile.generateHtmlTestresultOutputNone()
|
||||||
else:
|
else:
|
||||||
outfile.generateHtmlTestresultOutputDetails(
|
outfile.generateHtmlTestresultOutputDetails(
|
||||||
|
|
|
||||||
|
|
@ -184,3 +184,12 @@ proc testMinMax(a,b: float32) =
|
||||||
|
|
||||||
testMinMax(0.0, NaN)
|
testMinMax(0.0, NaN)
|
||||||
testMinMax(NaN, 0.0)
|
testMinMax(NaN, 0.0)
|
||||||
|
|
||||||
|
|
||||||
|
block:
|
||||||
|
type Foo = enum
|
||||||
|
k1, k2
|
||||||
|
var
|
||||||
|
a = {k1}
|
||||||
|
b = {k1,k2}
|
||||||
|
doAssert a < b
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue