mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-20 09:58:35 +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:
@@ -47,8 +47,7 @@ proc initDefines*(symbols: StringTableRef) =
|
||||
defineSymbol("nimparsebiggestfloatmagic") # deadcode
|
||||
defineSymbol("nimalias") # deadcode
|
||||
defineSymbol("nimlocks") # deadcode
|
||||
defineSymbol("nimnode") # deadcode pending `nimnode` reference in opengl package
|
||||
# refs https://github.com/nim-lang/opengl/pull/79
|
||||
defineSymbol("nimnode") # deadcode
|
||||
defineSymbol("nimvarargstyped") # deadcode
|
||||
defineSymbol("nimtypedescfixed") # deadcode
|
||||
defineSymbol("nimKnowsNimvm") # deadcode
|
||||
|
||||
@@ -12,10 +12,7 @@ import std/[os, strutils, parseopt]
|
||||
when defined(nimPreviewSlimSystem):
|
||||
import std/assertions
|
||||
|
||||
when defined(windows) and not defined(nimKochBootstrap):
|
||||
# remove workaround pending bootstrap >= 1.5.1
|
||||
# refs https://github.com/nim-lang/Nim/issues/18334#issuecomment-867114536
|
||||
# alternative would be to prepend `currentSourcePath.parentDir.quoteShell`
|
||||
when defined(windows):
|
||||
when defined(gcc):
|
||||
when defined(x86):
|
||||
{.link: "../icons/nim.res".}
|
||||
|
||||
@@ -867,14 +867,6 @@ template patchModule(conf: ConfigRef) {.dirty.} =
|
||||
let ov = conf.moduleOverrides[key]
|
||||
if ov.len > 0: result = AbsoluteFile(ov)
|
||||
|
||||
when (NimMajor, NimMinor) < (1, 1) or not declared(isRelativeTo):
|
||||
proc isRelativeTo(path, base: string): bool =
|
||||
# pending #13212 use os.isRelativeTo
|
||||
let path = path.normalizedPath
|
||||
let base = base.normalizedPath
|
||||
let ret = relativePath(path, base)
|
||||
result = path.len > 0 and not ret.startsWith ".."
|
||||
|
||||
const stdlibDirs* = [
|
||||
"pure", "core", "arch",
|
||||
"pure/collections",
|
||||
|
||||
@@ -1380,15 +1380,9 @@ proc gsub(g: var TSrcGen, n: PNode, c: TContext, fromStmtList = false) =
|
||||
of nkAccQuoted:
|
||||
put(g, tkAccent, "`")
|
||||
for i in 0..<n.len:
|
||||
proc getStrVal(n: PNode): string =
|
||||
# pending https://github.com/nim-lang/Nim/pull/17540, use `getStrVal`
|
||||
case n.kind
|
||||
of nkIdent: n.ident.s
|
||||
of nkSym: n.sym.name.s
|
||||
else: ""
|
||||
proc isAlpha(n: PNode): bool =
|
||||
if n.kind in {nkIdent, nkSym}:
|
||||
let tmp = n.getStrVal
|
||||
let tmp = n.getPIdent.s
|
||||
result = tmp.len > 0 and tmp[0] in {'a'..'z', 'A'..'Z'}
|
||||
var useSpace = false
|
||||
if i == 1 and n[0].kind == nkIdent and n[0].ident.s in ["=", "'"]:
|
||||
|
||||
@@ -11,7 +11,7 @@ cppDefine "NAN"
|
||||
when defined(nimStrictMode):
|
||||
# xxx add more flags here, and use `-d:nimStrictMode` in more contexts in CI.
|
||||
|
||||
# pending bug #14246, enable this:
|
||||
# enable this:
|
||||
# when defined(nimHasWarningAsError):
|
||||
# switch("warningAsError", "UnusedImport")
|
||||
|
||||
|
||||
@@ -1016,10 +1016,8 @@ func isValidFilename*(filename: string, maxLen = 259.Positive): bool {.since: (1
|
||||
|
||||
|
||||
# deprecated declarations
|
||||
when not defined(nimscript):
|
||||
when not defined(js): # `noNimJs` doesn't work with templates, this should improve.
|
||||
template existsFile*(args: varargs[untyped]): untyped {.deprecated: "use fileExists".} =
|
||||
fileExists(args)
|
||||
template existsDir*(args: varargs[untyped]): untyped {.deprecated: "use dirExists".} =
|
||||
dirExists(args)
|
||||
# {.deprecated: [existsFile: fileExists].} # pending bug #14819; this would avoid above mentioned issue
|
||||
when not weirdTarget:
|
||||
template existsFile*(args: varargs[untyped]): untyped {.deprecated: "use fileExists".} =
|
||||
fileExists(args)
|
||||
template existsDir*(args: varargs[untyped]): untyped {.deprecated: "use dirExists".} =
|
||||
dirExists(args)
|
||||
|
||||
@@ -81,7 +81,6 @@ when not defined(nimscript):
|
||||
doAssert false
|
||||
|
||||
proc setProgramResult*(a: int) =
|
||||
# pending https://github.com/nim-lang/Nim/issues/14674
|
||||
when defined(js) and defined(nodejs):
|
||||
asm """
|
||||
process.exitCode = `a`;
|
||||
|
||||
@@ -110,7 +110,7 @@ func `==`*(x, y: JsBigInt): bool {.importjs: "(# == #)".} =
|
||||
doAssert big"42" == big"42"
|
||||
|
||||
func `**`*(x, y: JsBigInt): JsBigInt {.importjs: "((#) $1 #)".} =
|
||||
# (#) needed, refs https://github.com/nim-lang/Nim/pull/16409#issuecomment-760550812
|
||||
# (#) needed due to unary minus
|
||||
runnableExamples:
|
||||
doAssert big"2" ** big"64" == big"18446744073709551616"
|
||||
doAssert big"-2" ** big"3" == big"-8"
|
||||
@@ -120,8 +120,6 @@ func `**`*(x, y: JsBigInt): JsBigInt {.importjs: "((#) $1 #)".} =
|
||||
try: discard big"2" ** big"-1" # raises foreign `RangeError`
|
||||
except: ok = true
|
||||
doAssert ok
|
||||
# pending https://github.com/nim-lang/Nim/pull/15940, simplify to:
|
||||
# doAssertRaises: discard big"2" ** big"-1" # raises foreign `RangeError`
|
||||
|
||||
func `and`*(x, y: JsBigInt): JsBigInt {.importjs: "(# & #)".} =
|
||||
runnableExamples:
|
||||
|
||||
@@ -371,7 +371,6 @@ proc toJsonHook*[K: string|cstring, V](t: (Table[K, V] | OrderedTable[K, V]), op
|
||||
##
|
||||
## See also:
|
||||
## * `fromJsonHook proc<#fromJsonHook,,JsonNode>`_
|
||||
# pending PR #9217 use: toSeq(a) instead of `collect` in `runnableExamples`.
|
||||
runnableExamples:
|
||||
import std/[tables, json, sugar]
|
||||
let foo = (
|
||||
|
||||
@@ -155,10 +155,14 @@ when hasCCopyfile:
|
||||
proc copyfile_state_alloc(): copyfile_state_t
|
||||
proc copyfile_state_free(state: copyfile_state_t): cint
|
||||
proc c_copyfile(src, dst: cstring, state: copyfile_state_t, flags: copyfile_flags_t): cint {.importc: "copyfile".}
|
||||
# replace with `let` pending bootstrap >= 1.4.0
|
||||
var
|
||||
COPYFILE_DATA {.nodecl.}: copyfile_flags_t
|
||||
COPYFILE_XATTR {.nodecl.}: copyfile_flags_t
|
||||
when (NimMajor, NimMinor) >= (1, 4):
|
||||
let
|
||||
COPYFILE_DATA {.nodecl.}: copyfile_flags_t
|
||||
COPYFILE_XATTR {.nodecl.}: copyfile_flags_t
|
||||
else:
|
||||
var
|
||||
COPYFILE_DATA {.nodecl.}: copyfile_flags_t
|
||||
COPYFILE_XATTR {.nodecl.}: copyfile_flags_t
|
||||
{.pop.}
|
||||
|
||||
type
|
||||
|
||||
@@ -23,8 +23,8 @@ proc add*(x: var string, y: openArray[char]) =
|
||||
# Use `{.noalias.}` ?
|
||||
let n = x.len
|
||||
x.setLen n + y.len
|
||||
# pending https://github.com/nim-lang/Nim/issues/14655#issuecomment-643671397
|
||||
# use x.setLen(n + y.len, isInit = false)
|
||||
# pending #19727
|
||||
# setLen unnecessarily zeros memory
|
||||
var i = 0
|
||||
while i < y.len:
|
||||
x[n + i] = y[i]
|
||||
|
||||
@@ -168,8 +168,10 @@ elif defined(windows):
|
||||
result = randomBytes(addr dest[0], size)
|
||||
|
||||
elif defined(linux) and not defined(nimNoGetRandom) and not defined(emscripten):
|
||||
# TODO using let, pending bootstrap >= 1.4.0
|
||||
var SYS_getrandom {.importc: "SYS_getrandom", header: "<sys/syscall.h>".}: clong
|
||||
when (NimMajor, NimMinor) >= (1, 4):
|
||||
let SYS_getrandom {.importc: "SYS_getrandom", header: "<sys/syscall.h>".}: clong
|
||||
else:
|
||||
var SYS_getrandom {.importc: "SYS_getrandom", header: "<sys/syscall.h>".}: clong
|
||||
const syscallHeader = """#include <unistd.h>
|
||||
#include <sys/syscall.h>"""
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ pkg "awk"
|
||||
pkg "bigints"
|
||||
pkg "binaryheap", "nim c -r binaryheap.nim"
|
||||
pkg "BipBuffer"
|
||||
pkg "blscurve", allowFailure = true # pending https://github.com/status-im/nim-blscurve/issues/39
|
||||
pkg "blscurve", allowFailure = true
|
||||
pkg "bncurve"
|
||||
pkg "brainfuck", "nim c -d:release -r tests/compile.nim"
|
||||
pkg "bump", "nim c --gc:arc --path:. -r tests/tbump.nim", "https://github.com/disruptek/bump", allowFailure = true
|
||||
@@ -58,7 +58,7 @@ pkg "cligen", "nim c --path:. -r cligen.nim"
|
||||
pkg "combparser", "nimble test --gc:orc"
|
||||
pkg "compactdict"
|
||||
pkg "comprehension", "nimble test", "https://github.com/alehander92/comprehension"
|
||||
pkg "criterion", allowFailure = true # pending https://github.com/disruptek/criterion/issues/3 (wrongly closed)
|
||||
pkg "criterion", allowFailure = true # needs testing binary
|
||||
pkg "datamancer"
|
||||
pkg "dashing", "nim c tests/functional.nim"
|
||||
pkg "delaunay"
|
||||
@@ -104,7 +104,6 @@ pkg "NimData", "nim c -o:nimdataa src/nimdata.nim"
|
||||
pkg "nimes", "nim c src/nimes.nim"
|
||||
pkg "nimfp", "nim c -o:nfp -r src/fp.nim"
|
||||
pkg "nimgame2", "nim c --mm:refc nimgame2/nimgame.nim"
|
||||
# XXX Doesn't work with deprecated 'randomize', will create a PR.
|
||||
pkg "nimgen", "nim c -o:nimgenn -r src/nimgen/runcfg.nim"
|
||||
pkg "nimib"
|
||||
pkg "nimlsp"
|
||||
|
||||
@@ -1,33 +1,16 @@
|
||||
discard """
|
||||
cmd: "nim check $options $file"
|
||||
errormsg: ""
|
||||
nimout: '''
|
||||
t8794.nim(39, 27) Error: undeclared field: 'a3' for type m8794.Foo3 [type declared in m8794.nim(1, 6)]
|
||||
'''
|
||||
"""
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## line 20
|
||||
|
||||
## issue #8794
|
||||
|
||||
import m8794
|
||||
|
||||
when false: # pending https://github.com/nim-lang/Nim/pull/10091 add this
|
||||
type Foo = object
|
||||
a1: int
|
||||
type Foo = object
|
||||
a1: int
|
||||
|
||||
discard Foo().a2
|
||||
discard Foo().a2 #[tt.Error
|
||||
^ undeclared field: 'a2' for type t8794.Foo [type declared in t8794.nim(9, 6)]]#
|
||||
|
||||
type Foo3b = Foo3
|
||||
var x2: Foo3b
|
||||
@@ -36,4 +19,5 @@ proc getFun[T](): T =
|
||||
var a: T
|
||||
a
|
||||
|
||||
discard getFun[type(x2)]().a3
|
||||
discard getFun[type(x2)]().a3 #[tt.Error
|
||||
^ undeclared field: 'a3' for type m8794.Foo3 [type declared in m8794.nim(1, 6)]]#
|
||||
|
||||
@@ -13,13 +13,6 @@ else:
|
||||
const nim = getCurrentCompilerExe()
|
||||
const file = currentSourcePath
|
||||
for b in "c js cpp".split:
|
||||
when defined(openbsd):
|
||||
if b == "js":
|
||||
# xxx bug: pending #13115
|
||||
# remove special case once nodejs updated >= 12.16.2
|
||||
# refs https://github.com/nim-lang/Nim/pull/16167#issuecomment-738270751
|
||||
continue
|
||||
|
||||
# save CI time by avoiding mostly redundant combinations as far as this bug is concerned
|
||||
var opts = case b
|
||||
of "c": @["", "-d:nim_t13115_static", "-d:danger", "-d:debug"]
|
||||
|
||||
@@ -41,8 +41,7 @@ template main =
|
||||
test ".1", 0.1
|
||||
test "-.1", -0.1
|
||||
test "-0", -0.0
|
||||
when false: # pending bug #18246
|
||||
test "-0", -0.0
|
||||
test "-0", -0'f # see #18246, -0 won't work
|
||||
test ".1e-1", 0.1e-1
|
||||
test "0_1_2_3.0_1_2_3E+0_1_2", 123.0123e12
|
||||
test "0_1_2.e-0", 12e0
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
{.warning[UnusedImport]: off.} # xxx bug: this shouldn't be needed since we have `export m3`
|
||||
import ./m3 {.all.}
|
||||
import ./m3 as m3b
|
||||
export m3b
|
||||
|
||||
@@ -28,7 +28,7 @@ template main2 = # bug #15958
|
||||
doAssert byLent(a) == [11,12]
|
||||
doAssert sameAddress(byLent(a), a)
|
||||
doAssert byLent(b) == @[21,23]
|
||||
# pending bug #16073
|
||||
# bug #16073
|
||||
doAssert sameAddress(byLent(b), b)
|
||||
doAssert byLent(ss) == {1, 2, 3, 5}
|
||||
doAssert sameAddress(byLent(ss), ss)
|
||||
|
||||
@@ -148,8 +148,6 @@ proc overloadedProc[T](x: T) =
|
||||
echo x
|
||||
|
||||
"""
|
||||
# XXX: There seems to be a repr rendering problem above.
|
||||
# Notice that `echo [x]`
|
||||
|
||||
inspectSymbol overloadedProc[float], """
|
||||
proc overloadedProc(x: T) =
|
||||
|
||||
@@ -30,7 +30,7 @@ accept bar(vbar)
|
||||
accept baz(vbar)
|
||||
accept baz(vbaz)
|
||||
|
||||
#reject baz(vnotbaz) # XXX this really shouldn't compile
|
||||
reject baz(vnotbaz)
|
||||
reject bar(vfoo)
|
||||
|
||||
# https://github.com/Araq/Nim/issues/517
|
||||
|
||||
@@ -49,25 +49,13 @@ macro autoClose(args: varargs[untyped]): untyped =
|
||||
var finallyBlock = newNimNode(nnkStmtList)
|
||||
finallyBlock.add(closingCalls)
|
||||
|
||||
# XXX: Use a template here once getAst is working properly
|
||||
var targetAst = parseStmt"""block:
|
||||
var
|
||||
x = foo()
|
||||
y = bar()
|
||||
|
||||
try:
|
||||
body()
|
||||
|
||||
finally:
|
||||
close x
|
||||
close y
|
||||
"""
|
||||
|
||||
targetAst[0][1][0] = varSection
|
||||
targetAst[0][1][1][0] = body
|
||||
targetAst[0][1][1][1][0] = finallyBlock
|
||||
|
||||
result = targetAst
|
||||
result = quote do:
|
||||
block:
|
||||
`varSection`
|
||||
try:
|
||||
`body`
|
||||
finally:
|
||||
`finallyBlock`
|
||||
|
||||
type
|
||||
TResource* = object
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
discard """
|
||||
# pending bug #16521 (bug 12) use `matrix`
|
||||
cmd: "nim c --spellsuggest:15 --hints:off $file"
|
||||
matrix: "--spellsuggest:15 --hints:off"
|
||||
action: "reject"
|
||||
nimout: '''
|
||||
tspellsuggest.nim(45, 13) Error: undeclared identifier: 'fooBar'
|
||||
@@ -27,6 +26,7 @@ candidates (edit distance, scope distance); see '--spellSuggest':
|
||||
|
||||
|
||||
|
||||
|
||||
# line 30
|
||||
import ./mspellsuggest
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
discard """
|
||||
# pending bug #16521 (bug 12) use `matrix`
|
||||
cmd: "nim c --spellsuggest:12 --hints:off $file"
|
||||
matrix: "--spellsuggest:12 --hints:off"
|
||||
action: "reject"
|
||||
nimout: '''
|
||||
tspellsuggest2.nim(45, 13) Error: undeclared identifier: 'fooBar'
|
||||
@@ -27,6 +26,7 @@ candidates (edit distance, scope distance); see '--spellSuggest':
|
||||
|
||||
|
||||
|
||||
|
||||
# line 30
|
||||
import ./mspellsuggest
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
discard """
|
||||
# pending bug #16521 (bug 12) use `matrix`
|
||||
cmd: "nim c --spellsuggest:4 --hints:off $file"
|
||||
matrix: "--spellsuggest:4 --hints:off"
|
||||
action: "reject"
|
||||
nimout: '''
|
||||
tspellsuggest3.nim(21, 1) Error: undeclared identifier: 'fooBar'
|
||||
@@ -12,6 +11,7 @@ candidates (edit distance, scope distance); see '--spellSuggest':
|
||||
'''
|
||||
"""
|
||||
|
||||
|
||||
import ./mspellsuggest
|
||||
import ./mspellsuggest
|
||||
import ./mspellsuggest
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
discard """
|
||||
cmd: "nim doc --doccmd:--hints:off --hints:off $file"
|
||||
cmd: '''nim doc --doccmd:"-d:testFooExternal --hints:off" --hints:off $file'''
|
||||
action: "compile"
|
||||
nimoutFull: true
|
||||
nimout: '''
|
||||
@@ -19,12 +19,6 @@ foo6
|
||||
joinable: false
|
||||
"""
|
||||
|
||||
#[
|
||||
pending bug #18077, use instead:
|
||||
cmd: "nim doc --doccmd:'-d:testFooExternal --hints:off' --hints:off $file"
|
||||
and merge trunnableexamples2 back here
|
||||
]#
|
||||
{.define(testFooExternal).}
|
||||
|
||||
proc fun*() =
|
||||
runnableExamples:
|
||||
@@ -212,3 +206,8 @@ snippet:
|
||||
doAssert defined(testFooExternal)
|
||||
|
||||
]##
|
||||
|
||||
when true: # runnableExamples with rdoccmd
|
||||
runnableExamples "-d:testFoo -d:testBar":
|
||||
doAssert defined(testFoo) and defined(testBar)
|
||||
doAssert defined(testFooExternal)
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
discard """
|
||||
cmd: "nim doc --doccmd:-d:testFooExternal --hints:off $file"
|
||||
action: "compile"
|
||||
joinable: false
|
||||
"""
|
||||
|
||||
# pending bug #18077, merge back inside trunnableexamples.nim
|
||||
when true: # runnableExamples with rdoccmd
|
||||
runnableExamples "-d:testFoo -d:testBar":
|
||||
doAssert defined(testFoo) and defined(testBar)
|
||||
doAssert defined(testFooExternal)
|
||||
@@ -1,7 +1,6 @@
|
||||
discard """
|
||||
output: '''
|
||||
9.0
|
||||
|
||||
'''
|
||||
"""
|
||||
|
||||
@@ -39,12 +38,11 @@ proc `^`(x: vfloat, exp: static[float]): vfloat =
|
||||
when exp == 0.5:
|
||||
sqrt(x)
|
||||
else:
|
||||
pow(x, exp)
|
||||
pow(x, exp)
|
||||
|
||||
proc `$`(x: vfloat): string =
|
||||
let y = cast[ptr float](addr x)
|
||||
# xxx not sure if intentional in this issue, but this returns ""
|
||||
echo y[]
|
||||
result = $y[]
|
||||
|
||||
let x = set1(9.0)
|
||||
echo x^0.5
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
discard """
|
||||
output: ""
|
||||
disabled: "freebsd"
|
||||
disabled: "freebsd" # see #15725
|
||||
"""
|
||||
# disabled pending bug #15725
|
||||
|
||||
import threadpool, os
|
||||
|
||||
var chan: Channel[int]
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -45,8 +45,7 @@ block: # `$`(SomeInteger)
|
||||
|
||||
check $int8.low == "-128"
|
||||
check $int8(-128) == "-128"
|
||||
when not defined js: # pending https://github.com/nim-lang/Nim/issues/14127
|
||||
check $cast[int8](-128) == "-128"
|
||||
check $cast[int8](-128) == "-128"
|
||||
|
||||
var a = 12345'u16
|
||||
check $a == "12345"
|
||||
|
||||
@@ -291,7 +291,7 @@ block: # bug #10815
|
||||
const a = P()
|
||||
doAssert $a == ""
|
||||
|
||||
when defined osx: # xxx bug https://github.com/nim-lang/Nim/issues/10815#issuecomment-476380734
|
||||
when defined osx: # xxx bug #13481
|
||||
block:
|
||||
type CharSet {.union.} = object
|
||||
cs: set[char]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## Part of 'koch' responsible for the documentation generation.
|
||||
|
||||
import std/[os, strutils, osproc, sets, pathnorm, sequtils]
|
||||
import std/[os, strutils, osproc, sets, pathnorm, sequtils, pegs]
|
||||
|
||||
import officialpackages
|
||||
export exec
|
||||
@@ -8,9 +8,6 @@ export exec
|
||||
when defined(nimPreviewSlimSystem):
|
||||
import std/assertions
|
||||
|
||||
# XXX: Remove this feature check once the csources supports it.
|
||||
when defined(nimHasCastPragmaBlocks):
|
||||
import std/pegs
|
||||
from std/private/globs import nativeToUnixPath, walkDirRecFilter, PathEntry
|
||||
import "../compiler/nimpaths"
|
||||
|
||||
@@ -373,9 +370,7 @@ proc buildDocs*(args: string, localOnly = false, localOutDir = "") =
|
||||
if not localOnly:
|
||||
buildDocsDir(args, webUploadOutput / NimVersion)
|
||||
|
||||
# XXX: Remove this feature check once the csources supports it.
|
||||
when defined(nimHasCastPragmaBlocks):
|
||||
let gaFilter = peg"@( y'--doc.googleAnalytics:' @(\s / $) )"
|
||||
args = args.replace(gaFilter)
|
||||
let gaFilter = peg"@( y'--doc.googleAnalytics:' @(\s / $) )"
|
||||
args = args.replace(gaFilter)
|
||||
|
||||
buildDocsDir(args, localOutDir)
|
||||
|
||||
Reference in New Issue
Block a user