summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authormetagn <metagngn@gmail.com>2023-05-11 11:23:52 +0300
committerGitHub <noreply@github.com>2023-05-11 10:23:52 +0200
commit02be212daee78e3fca9f6b9524c4f3b221e552f3 (patch)
tree72ae4923ab997d476864d971cd5589143ed71dc8 /tests
parent3a08e2e6ace20f086ba24360c7139852a75b93b2 (diff)
downloadNim-02be212daee78e3fca9f6b9524c4f3b221e552f3.tar.gz
clean up SOME pending/xxx/issue link comments (#21826)
* clean up SOME pending/xxx/issue link comments

* great
Diffstat (limited to 'tests')
-rw-r--r--tests/errmsgs/t8794.nim28
-rw-r--r--tests/exception/t13115.nim7
-rw-r--r--tests/float/tfloats.nim3
-rw-r--r--tests/importalls/m4.nim1
-rw-r--r--tests/lent/tbasic_lent_check.nim2
-rw-r--r--tests/macros/ttemplatesymbols.nim2
-rw-r--r--tests/metatype/tcompositetypeclasses.nim2
-rw-r--r--tests/misc/tcsharpusingstatement.nim26
-rw-r--r--tests/misc/tspellsuggest.nim4
-rw-r--r--tests/misc/tspellsuggest2.nim4
-rw-r--r--tests/misc/tspellsuggest3.nim4
-rw-r--r--tests/nimdoc/trunnableexamples.nim13
-rw-r--r--tests/nimdoc/trunnableexamples2.nim11
-rw-r--r--tests/overload/tstatic_with_converter.nim6
-rw-r--r--tests/parallel/tblocking_channel.nim4
-rw-r--r--tests/stdlib/tdecls.nim24
-rw-r--r--tests/stdlib/tosproc.nim8
-rw-r--r--tests/stdlib/trandom.nim45
-rw-r--r--tests/stdlib/tssl.nim8
-rw-r--r--tests/system/tdollars.nim3
-rw-r--r--tests/vm/tvmmisc.nim2
21 files changed, 82 insertions, 125 deletions
diff --git a/tests/errmsgs/t8794.nim b/tests/errmsgs/t8794.nim
index 9db54a9c7..36f05dbad 100644
--- a/tests/errmsgs/t8794.nim
+++ b/tests/errmsgs/t8794.nim
@@ -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)]]#
diff --git a/tests/exception/t13115.nim b/tests/exception/t13115.nim
index ee1daed26..5db8f9107 100644
--- a/tests/exception/t13115.nim
+++ b/tests/exception/t13115.nim
@@ -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"]
diff --git a/tests/float/tfloats.nim b/tests/float/tfloats.nim
index 480396e81..967605c53 100644
--- a/tests/float/tfloats.nim
+++ b/tests/float/tfloats.nim
@@ -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
diff --git a/tests/importalls/m4.nim b/tests/importalls/m4.nim
index b682b766a..77ec65c61 100644
--- a/tests/importalls/m4.nim
+++ b/tests/importalls/m4.nim
@@ -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
diff --git a/tests/lent/tbasic_lent_check.nim b/tests/lent/tbasic_lent_check.nim
index 92d731451..ce9b89adf 100644
--- a/tests/lent/tbasic_lent_check.nim
+++ b/tests/lent/tbasic_lent_check.nim
@@ -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)
diff --git a/tests/macros/ttemplatesymbols.nim b/tests/macros/ttemplatesymbols.nim
index 280b34ff1..3182de79d 100644
--- a/tests/macros/ttemplatesymbols.nim
+++ b/tests/macros/ttemplatesymbols.nim
@@ -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) =
diff --git a/tests/metatype/tcompositetypeclasses.nim b/tests/metatype/tcompositetypeclasses.nim
index d125b119b..43b6a57e4 100644
--- a/tests/metatype/tcompositetypeclasses.nim
+++ b/tests/metatype/tcompositetypeclasses.nim
@@ -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
diff --git a/tests/misc/tcsharpusingstatement.nim b/tests/misc/tcsharpusingstatement.nim
index dd4cf589d..1ce553895 100644
--- a/tests/misc/tcsharpusingstatement.nim
+++ b/tests/misc/tcsharpusingstatement.nim
@@ -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
diff --git a/tests/misc/tspellsuggest.nim b/tests/misc/tspellsuggest.nim
index 345458bb1..ea0a98cd3 100644
--- a/tests/misc/tspellsuggest.nim
+++ b/tests/misc/tspellsuggest.nim
@@ -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
 
diff --git a/tests/misc/tspellsuggest2.nim b/tests/misc/tspellsuggest2.nim
index d20fb00dc..4bf05799e 100644
--- a/tests/misc/tspellsuggest2.nim
+++ b/tests/misc/tspellsuggest2.nim
@@ -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
 
diff --git a/tests/misc/tspellsuggest3.nim b/tests/misc/tspellsuggest3.nim
index 9b0b84602..bd4d5256f 100644
--- a/tests/misc/tspellsuggest3.nim
+++ b/tests/misc/tspellsuggest3.nim
@@ -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
diff --git a/tests/nimdoc/trunnableexamples.nim b/tests/nimdoc/trunnableexamples.nim
index 1886ceeb3..57e725b2e 100644
--- a/tests/nimdoc/trunnableexamples.nim
+++ b/tests/nimdoc/trunnableexamples.nim
@@ -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)
diff --git a/tests/nimdoc/trunnableexamples2.nim b/tests/nimdoc/trunnableexamples2.nim
deleted file mode 100644
index 5a437744e..000000000
--- a/tests/nimdoc/trunnableexamples2.nim
+++ /dev/null
@@ -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)
diff --git a/tests/overload/tstatic_with_converter.nim b/tests/overload/tstatic_with_converter.nim
index e830e8a22..2bc1dfaab 100644
--- a/tests/overload/tstatic_with_converter.nim
+++ b/tests/overload/tstatic_with_converter.nim
@@ -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
diff --git a/tests/parallel/tblocking_channel.nim b/tests/parallel/tblocking_channel.nim
index eb5fcb715..f3ccd166a 100644
--- a/tests/parallel/tblocking_channel.nim
+++ b/tests/parallel/tblocking_channel.nim
@@ -1,8 +1,8 @@
 discard """
 output: ""
-disabled: "freebsd"
+disabled: "freebsd" # see #15725
 """
-# disabled pending bug #15725
+
 import threadpool, os
 
 var chan: Channel[int]
diff --git a/tests/stdlib/tdecls.nim b/tests/stdlib/tdecls.nim
index c17fd3343..42dc646f2 100644
--- a/tests/stdlib/tdecls.nim
+++ b/tests/stdlib/tdecls.nim
@@ -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])
-
-    doAssert not compiles(block:
-      # ditto
-      var foo {.byaddr.} = s[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])
+  {.pop.}
 
   block:
     var b {.byaddr.} = s[1] # redeclaration ok in sub scope
diff --git a/tests/stdlib/tosproc.nim b/tests/stdlib/tosproc.nim
index 1184503f5..da4f6252d 100644
--- a/tests/stdlib/tosproc.nim
+++ b/tests/stdlib/tosproc.nim
@@ -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
diff --git a/tests/stdlib/trandom.nim b/tests/stdlib/trandom.nim
index 4104ad1a4..8784b33ee 100644
--- a/tests/stdlib/trandom.nim
+++ b/tests/stdlib/trandom.nim
@@ -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()
diff --git a/tests/stdlib/tssl.nim b/tests/stdlib/tssl.nim
index 0e3f9cd82..1628b9326 100644
--- a/tests/stdlib/tssl.nim
+++ b/tests/stdlib/tssl.nim
@@ -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
diff --git a/tests/system/tdollars.nim b/tests/system/tdollars.nim
index 913db7c86..39337cca7 100644
--- a/tests/system/tdollars.nim
+++ b/tests/system/tdollars.nim
@@ -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"
diff --git a/tests/vm/tvmmisc.nim b/tests/vm/tvmmisc.nim
index c29dd5010..11fdcbd8c 100644
--- a/tests/vm/tvmmisc.nim
+++ b/tests/vm/tvmmisc.nim
@@ -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]