summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2019-08-07 22:40:58 +0200
committerGitHub <noreply@github.com>2019-08-07 22:40:58 +0200
commitc0d240b8cd3dc08d25c671b0dc7614fbfa980c2e (patch)
tree82ca82c0cd8d8dc7bd164d352d9b5a1910cd7164 /tests
parentf34ae81971ada93fd4fda871c3da6cba9aab8bff (diff)
downloadNim-c0d240b8cd3dc08d25c671b0dc7614fbfa980c2e.tar.gz
fixes #11807 (#11900)
* fixes #11807
* make tests green again
Diffstat (limited to 'tests')
-rw-r--r--tests/concepts/t3330.nim12
-rw-r--r--tests/destructor/tnewruntime_misc.nim (renamed from tests/destructor/tsimpletable.nim)10
2 files changed, 14 insertions, 8 deletions
diff --git a/tests/concepts/t3330.nim b/tests/concepts/t3330.nim
index 6bf52f3aa..ed1590e16 100644
--- a/tests/concepts/t3330.nim
+++ b/tests/concepts/t3330.nim
@@ -13,21 +13,21 @@ proc add[T](x: var seq[T]; y: openArray[T])
   first type mismatch at position: 1
   required type for x: var seq[T]
   but expression 'k' is of type: Alias
-proc add(result: var string; x: float)
+proc add[T](x: var seq[T]; y: T)
   first type mismatch at position: 1
-  required type for result: var string
+  required type for x: var seq[T]
   but expression 'k' is of type: Alias
-proc add(x: var string; y: string)
+proc add(result: var string; x: float)
   first type mismatch at position: 1
-  required type for x: var string
+  required type for result: var string
   but expression 'k' is of type: Alias
 proc add(x: var string; y: cstring)
   first type mismatch at position: 1
   required type for x: var string
   but expression 'k' is of type: Alias
-proc add[T](x: var seq[T]; y: T)
+proc add(x: var string; y: string)
   first type mismatch at position: 1
-  required type for x: var seq[T]
+  required type for x: var string
   but expression 'k' is of type: Alias
 proc add(result: var string; x: int64)
   first type mismatch at position: 1
diff --git a/tests/destructor/tsimpletable.nim b/tests/destructor/tnewruntime_misc.nim
index 34a4ac063..029a2a78d 100644
--- a/tests/destructor/tsimpletable.nim
+++ b/tests/destructor/tnewruntime_misc.nim
@@ -1,7 +1,8 @@
 discard """
   cmd: '''nim cpp --newruntime $file'''
   output: '''(field: "value")
-3 3  new: 0'''
+Indeed
+0  new: 0'''
 """
 
 import core / allocators
@@ -13,10 +14,15 @@ type
   Node = ref object
     field: string
 
+# bug #11807
+import os
+putEnv("HEAPTRASHING", "Indeed")
+
 proc main =
   var w = newTable[string, owned Node]()
   w["key"] = Node(field: "value")
   echo w["key"][]
+  echo getEnv("HEAPTRASHING")
 
 main()
 
@@ -41,4 +47,4 @@ type
 var t: MyType
 
 let (a, d) = allocCounters()
-discard cprintf("%ld %ld  new: %ld\n", a, d, allocs)
+discard cprintf("%ld  new: %ld\n", a - unpairedEnvAllocs() - d, allocs)