summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorDanil Yarantsev <tiberiumk12@gmail.com>2020-06-25 06:38:08 +0300
committerGitHub <noreply@github.com>2020-06-24 20:38:08 -0700
commit03271593446f72cb99ebe8b68121999ba7ea8021 (patch)
treed40e776dd1f76a0a146c00385aaeaf5ea9c4140b /tests
parent80952cadaab41ab198a22be5f245eb2ea678ddfa (diff)
downloadNim-03271593446f72cb99ebe8b68121999ba7ea8021.tar.gz
Add test-cases to some fixed issues to close them (#14795)
Diffstat (limited to 'tests')
-rw-r--r--tests/async/tasync_misc.nim7
-rw-r--r--tests/generics/tgenerics_issues.nim18
-rw-r--r--tests/metatype/ttypedesc1.nim6
-rw-r--r--tests/misc/tints.nim4
4 files changed, 35 insertions, 0 deletions
diff --git a/tests/async/tasync_misc.nim b/tests/async/tasync_misc.nim
index 29e6faa72..ec1418e8c 100644
--- a/tests/async/tasync_misc.nim
+++ b/tests/async/tasync_misc.nim
@@ -74,3 +74,10 @@ block: # issue #13899
       result = true
   doAssert waitFor testFooSucceed()
   doAssert waitFor testFooFails()
+
+block: # issue #9313
+  doAssert compiles(block:
+    proc a() {.async.} =
+      echo "Hi"
+      quit(0)
+  )
diff --git a/tests/generics/tgenerics_issues.nim b/tests/generics/tgenerics_issues.nim
index af71a8938..54360f178 100644
--- a/tests/generics/tgenerics_issues.nim
+++ b/tests/generics/tgenerics_issues.nim
@@ -762,3 +762,21 @@ block t3717:
 
   var f: Foo[Foo[int]]
   discard foo(f)
+
+
+
+block: # issue #9458
+  type
+    Option[T] = object
+      val: T
+      has: bool
+    
+    Bar = object
+
+  proc none(T: typedesc): Option[T] =
+    discard
+
+  proc foo[T](self: T; x: Option[Bar] = Bar.none) = 
+    discard
+
+  foo(1)
diff --git a/tests/metatype/ttypedesc1.nim b/tests/metatype/ttypedesc1.nim
index 837c8eccc..549dbc62a 100644
--- a/tests/metatype/ttypedesc1.nim
+++ b/tests/metatype/ttypedesc1.nim
@@ -60,3 +60,9 @@ reject:
 reject:
   foo seq[int], ss
 
+# issue #12398
+reject:
+  let xs = [int, float, string]
+
+reject:
+  let data = @[int, typedesc]
diff --git a/tests/misc/tints.nim b/tests/misc/tints.nim
index fa3eb42cb..d24cbd4ac 100644
--- a/tests/misc/tints.nim
+++ b/tests/misc/tints.nim
@@ -77,5 +77,9 @@ block: # Casts to uint
 
   testCast(-5'i32, uint8, 251'u8)
 
+# issue #7174
+let c = 1'u
+let val = c > 0
+doAssert val 
 
 echo("Success") #OUT Success