made tests green again

This commit is contained in:
Araq 2012-09-18 00:36:48 +02:00
commit a71c5f98ea
5 changed files with 19 additions and 12 deletions

View file

@ -41,7 +41,7 @@ proc binarySearch*[T](a: openarray[T], key: T): int =
var mid = (result + b) div 2
if a[mid] < key: result = mid + 1
else: b = mid
if result >= len(x) or a[result] != key: result = -1
if result >= len(a) or a[result] != key: result = -1
proc smartBinarySearch*[T](a: openArray[T], key: T): int =
## ``a.len`` must be a power of 2 for this to work.

View file

@ -1673,6 +1673,10 @@ template newException*(exceptn: typeDesc, message: string): expr =
e.msg = message
e
proc getTypeInfo*[T](x: T): pointer {.magic: "GetTypeInfo".}
## get type information for `x`. Ordinary code should not use this, but
## the `typeinfo` module instead.
when not defined(EcmaScript) and not defined(NimrodVM):
{.push stack_trace: off, profiler:off.}
@ -2201,10 +2205,6 @@ proc `[]=`*[T](s: var seq[T], x: TSlice[int], b: openArray[T]) =
for i in 0 .. <L: s[i+a] = b[i]
else:
spliceImpl(s, a, L, b)
proc getTypeInfo*[T](x: T): pointer {.magic: "GetTypeInfo".}
## get type information for `x`. Ordinary code should not use this, but
## the `typeinfo` module instead.
proc slurp*(filename: string): string {.magic: "Slurp".}
proc staticRead*(filename: string): string {.magic: "Slurp".}