unittest module works again
This commit is contained in:
parent
383fbca27e
commit
5073914b86
6 changed files with 20 additions and 28 deletions
|
|
@ -37,8 +37,8 @@ var
|
|||
|
||||
checkpoints: seq[string] = @[]
|
||||
|
||||
template TestSetupIMPL*: stmt {.immediate, dirty.} = nil
|
||||
template TestTeardownIMPL*: stmt {.immediate, dirty.} = nil
|
||||
template TestSetupIMPL*: stmt {.immediate, dirty.} = discard
|
||||
template TestTeardownIMPL*: stmt {.immediate, dirty.} = discard
|
||||
|
||||
proc shouldRun(testName: string): bool =
|
||||
result = true
|
||||
|
|
@ -126,7 +126,7 @@ macro check*(conditions: stmt): stmt {.immediate.} =
|
|||
for i in 1 .. <exp.len:
|
||||
if exp[i].kind notin nnkLiterals:
|
||||
inc counter
|
||||
var arg = newIdentNode(":p" & ($counter))
|
||||
var arg = newIdentNode(":p" & $counter)
|
||||
var argStr = exp[i].toStrLit
|
||||
if exp[i].kind in nnkCallKinds: inspectArgs(exp[i])
|
||||
argsAsgns.add getAst(asgn(arg, exp[i]))
|
||||
|
|
@ -146,7 +146,8 @@ macro check*(conditions: stmt): stmt {.immediate.} =
|
|||
|
||||
var checkedStr = checked.toStrLit
|
||||
inspectArgs(checked)
|
||||
result = getAst(rewrite(checked, checked.lineinfo, checkedStr, argsAsgns, argsPrintOuts))
|
||||
result = getAst(rewrite(checked, checked.lineinfo, checkedStr,
|
||||
argsAsgns, argsPrintOuts))
|
||||
|
||||
of nnkStmtList:
|
||||
result = newNimNode(nnkStmtList)
|
||||
|
|
@ -176,7 +177,7 @@ macro expect*(exceptions: varargs[expr], body: stmt): stmt {.immediate.} =
|
|||
checkpoint(lineInfoLit & ": Expect Failed, no exception was thrown.")
|
||||
fail()
|
||||
except errorTypes:
|
||||
nil
|
||||
discard
|
||||
|
||||
var body = exp[exp.len - 1]
|
||||
|
||||
|
|
|
|||
|
|
@ -21856,15 +21856,9 @@ proc InflateRect*(lprc: var TRect, dx, dy: int): WINBOOL{.stdcall,
|
|||
dynlib: "user32", importc: "InflateRect".}
|
||||
proc InitializeAcl*(pAcl: var TACL, nAclLength, dwAclRevision: DWORD): WINBOOL{.
|
||||
stdcall, dynlib: "advapi32", importc: "InitializeAcl".}
|
||||
proc InitializeCriticalSectionAndSpinCount*(
|
||||
lpCriticalSection: var TRTLCriticalSection, dwSpinCount: DWORD): WINBOOL{.
|
||||
stdcall, dynlib: "kernel32",
|
||||
importc: "InitializeCriticalSectionAndSpinCount".}
|
||||
proc InitializeSid*(Sid: Pointer, pIdentifierAuthority: TSIDIdentifierAuthority,
|
||||
nSubAuthorityCount: int8): WINBOOL{.stdcall,
|
||||
dynlib: "advapi32", importc: "InitializeSid".}
|
||||
proc InsertMenuItem*(p1: HMENU, p2: UINT, p3: WINBOOL, p4: TMenuItemInfo): WINBOOL{.
|
||||
stdcall, dynlib: "user32", importc: "InsertMenuItemA".}
|
||||
proc InsertMenuItemA*(p1: HMENU, p2: UINT, p3: WINBOOL, p4: TMenuItemInfoA): WINBOOL{.
|
||||
stdcall, dynlib: "user32", importc: "InsertMenuItemA".}
|
||||
#function InsertMenuItemW(p1: HMENU; p2: UINT; p3: WINBOOL; const p4: TMenuItemInfoW): WINBOOL; stdcall; external 'user32' name 'InsertMenuItemW';
|
||||
|
|
@ -22362,11 +22356,6 @@ proc SetConsoleCursorInfo*(hConsoleOutput: THandle,
|
|||
lpConsoleCursorInfo: TConsoleCursorInfo): WINBOOL{.
|
||||
stdcall, dynlib: "kernel32", importc: "SetConsoleCursorInfo".}
|
||||
#function SetConsoleWindowInfo(hConsoleOutput: THandle; bAbsolute: WINBOOL; const lpConsoleWindow: TSmallRect): WINBOOL; stdcall; external 'kernel32' name 'SetConsoleWindowInfo';
|
||||
proc SetCriticalSectionSpinCount*(lpCriticalSection: var TRTLCriticalSection,
|
||||
dwSpinCount: DWORD): DWORD{.stdcall,
|
||||
dynlib: "kernel32", importc: "SetCriticalSectionSpinCount".}
|
||||
proc SetDeviceGammaRamp*(DC: HDC, Ramp: pointer): WINBOOL{.stdcall,
|
||||
dynlib: "gdi32", importc: "SetDeviceGammaRamp".}
|
||||
proc SetDIBColorTable*(DC: HDC, p2, p3: UINT, RGBQuadSTructs: pointer): UINT{.
|
||||
stdcall, dynlib: "gdi32", importc: "SetDIBColorTable".}
|
||||
proc SetDIBits*(DC: HDC, Bitmap: HBITMAP, StartScan, NumScans: UINT,
|
||||
|
|
@ -22476,8 +22465,6 @@ proc TranslateMDISysAccel*(hWndClient: HWND, lpMsg: TMsg): WINBOOL{.stdcall,
|
|||
proc TranslateMessage*(lpMsg: TMsg): WINBOOL{.stdcall, dynlib: "user32",
|
||||
importc: "TranslateMessage".}
|
||||
#function TransparentDIBits(DC: HDC; p2, p3, p4, p5: Integer; const p6: Pointer; const p7: PBitmapInfo; p8: UINT; p9, p10, p11, p12: Integer; p13: UINT): WINBOOL;stdcall; external 'gdi32' name 'TransparentDIBits';
|
||||
proc TryEnterCriticalSection*(lpCriticalSection: var TRTLCriticalSection): WINBOOL{.
|
||||
stdcall, dynlib: "kernel32", importc: "TryEnterCriticalSection".}
|
||||
proc UnhandledExceptionFilter*(ExceptionInfo: TExceptionPointers): int32{.
|
||||
stdcall, dynlib: "kernel32", importc: "UnhandledExceptionFilter".}
|
||||
proc UnionRect*(lprcDst: var TRect, lprcSrc1, lprcSrc2: TRect): WINBOOL{.
|
||||
|
|
@ -22847,12 +22834,6 @@ proc SUBLANGID*(lgid: int32): int32 =
|
|||
# return type might be wrong
|
||||
result = toU16(lgid) shr 10'i16
|
||||
|
||||
proc LANGIDFROMLCID*(lcid: int32): int16 =
|
||||
result = toU16(lcid)
|
||||
|
||||
proc SORTIDFROMLCID*(lcid: int32): int16 =
|
||||
result = toU16((lcid and 0x000FFFFF'i32) shr 16'i32)
|
||||
|
||||
proc MAKELCID*(lgid, srtid: int32): DWORD =
|
||||
result = toU32(srtid shl 16'i32 or lgid and 0xffff'i32)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue