mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-21 00:11:26 +00:00
clean up SOME pending/xxx/issue link comments (#21826)
* clean up SOME pending/xxx/issue link comments * great
This commit is contained in:
@@ -14,18 +14,18 @@ template fun() =
|
||||
var b {.byaddr.}: int = s[0]
|
||||
doAssert a.addr == b.addr
|
||||
|
||||
when false:
|
||||
# template specific redeclaration issue
|
||||
# see https://github.com/nim-lang/Nim/issues/8275
|
||||
doAssert not compiles(block:
|
||||
# redeclaration not allowed
|
||||
var foo = 0
|
||||
var foo {.byaddr.} = s[0])
|
||||
{.push warningAsError[ImplicitTemplateRedefinition]: on.}
|
||||
# in the future ImplicitTemplateRedefinition will be an error anyway
|
||||
doAssert not compiles(block:
|
||||
# redeclaration not allowed
|
||||
var foo = 0
|
||||
var foo {.byaddr.} = s[0])
|
||||
|
||||
doAssert not compiles(block:
|
||||
# ditto
|
||||
var foo {.byaddr.} = s[0]
|
||||
var foo {.byaddr.} = s[0])
|
||||
doAssert not compiles(block:
|
||||
# ditto
|
||||
var foo {.byaddr.} = s[0]
|
||||
var foo {.byaddr.} = s[0])
|
||||
{.pop.}
|
||||
|
||||
block:
|
||||
var b {.byaddr.} = s[1] # redeclaration ok in sub scope
|
||||
|
||||
@@ -94,9 +94,7 @@ else: # main driver
|
||||
const sourcePath = currentSourcePath()
|
||||
let dir = getCurrentDir() / "tests" / "osproc"
|
||||
|
||||
template deferScoped(cleanup, body) =
|
||||
# pending https://github.com/nim-lang/RFCs/issues/236#issuecomment-646855314
|
||||
# xxx move to std/sugar or (preferably) some low level module
|
||||
template deferring(cleanup, body) =
|
||||
try: body
|
||||
finally: cleanup
|
||||
|
||||
@@ -250,14 +248,14 @@ else: # main driver
|
||||
var x = newStringOfCap(120)
|
||||
block: # startProcess stdout poStdErrToStdOut (replaces old test `tstdout` + `ta_out`)
|
||||
var p = startProcess(output, dir, options={poStdErrToStdOut})
|
||||
deferScoped: p.close()
|
||||
deferring: p.close()
|
||||
do:
|
||||
var sout: seq[string]
|
||||
while p.outputStream.readLine(x): sout.add x
|
||||
doAssert sout == @["start ta_out", "to stdout", "to stdout", "to stderr", "to stderr", "to stdout", "to stdout", "end ta_out"]
|
||||
block: # startProcess stderr (replaces old test `tstderr` + `ta_out`)
|
||||
var p = startProcess(output, dir, options={})
|
||||
deferScoped: p.close()
|
||||
deferring: p.close()
|
||||
do:
|
||||
var serr, sout: seq[string]
|
||||
while p.errorStream.readLine(x): serr.add x
|
||||
|
||||
@@ -192,9 +192,7 @@ block: # bug #17467
|
||||
# This used to fail for each i in 0..<26844, i.e. the 1st produced value
|
||||
# was predictable and < 1e-4, skewing distributions.
|
||||
|
||||
const withUint = false # pending exporting `proc rand[T: uint | uint64](r: var Rand; max: T): T =`
|
||||
|
||||
block: # bug #16360
|
||||
block: # bug #16360, Natural overload
|
||||
var r = initRand()
|
||||
template test(a) =
|
||||
let a2 = a
|
||||
@@ -206,23 +204,38 @@ block: # bug #16360
|
||||
let a3 = rand(a2)
|
||||
doAssert a3 <= a2
|
||||
doAssert a3.type is a2.type
|
||||
when withUint:
|
||||
test cast[uint](int.high)
|
||||
test cast[uint](int.high) + 1
|
||||
whenJsNoBigInt64: discard
|
||||
do:
|
||||
test uint64.high
|
||||
test uint64.high - 1
|
||||
test uint.high - 2
|
||||
test uint.high - 1
|
||||
test uint.high
|
||||
test int.high
|
||||
test int.high - 1
|
||||
test int.high - 2
|
||||
test 0
|
||||
when withUint:
|
||||
test 0'u
|
||||
test 0'u64
|
||||
|
||||
block: # same as above but use slice overload
|
||||
var r = initRand()
|
||||
template test[T](a: T) =
|
||||
let a2: T = a
|
||||
block:
|
||||
let a3 = r.rand(T(0) .. a2)
|
||||
doAssert a3 <= a2
|
||||
doAssert a3.type is a2.type
|
||||
block:
|
||||
let a3 = rand(T(0) .. a2)
|
||||
doAssert a3 <= a2
|
||||
doAssert a3.type is a2.type
|
||||
test cast[uint](int.high)
|
||||
test cast[uint](int.high) + 1
|
||||
whenJsNoBigInt64: discard
|
||||
do:
|
||||
test uint64.high
|
||||
test uint64.high - 1
|
||||
test uint.high - 2
|
||||
test uint.high - 1
|
||||
test uint.high
|
||||
test int.high
|
||||
test int.high - 1
|
||||
test int.high - 2
|
||||
test 0
|
||||
test 0'u
|
||||
test 0'u64
|
||||
|
||||
block: # bug #16296
|
||||
var r = initRand()
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
discard """
|
||||
matrix: "--mm:refc; --mm:orc"
|
||||
joinable: false
|
||||
disabled: "freebsd"
|
||||
disabled: "openbsd"
|
||||
disabled: "netbsd"
|
||||
disabled: "freebsd" # see #15713
|
||||
disabled: "openbsd" # see #15713
|
||||
disabled: "netbsd" # see #15713
|
||||
"""
|
||||
# disabled: pending bug #15713
|
||||
|
||||
import std/[net, nativesockets, assertions, typedthreads]
|
||||
|
||||
when defined(posix): import os, posix
|
||||
|
||||
Reference in New Issue
Block a user