summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorhlaaftana <10591326+hlaaftana@users.noreply.github.com>2020-04-26 11:12:16 +0300
committerGitHub <noreply@github.com>2020-04-26 10:12:16 +0200
commit76ffa4fa25ebf8f03a399a343088fa46e4ee13cb (patch)
treebe20f16f3064c88383d554c44745fa02e3f744e1 /tests
parent31ba27590c6a2ddd5e6b65247b2d9f74b8ca1ba2 (diff)
downloadNim-76ffa4fa25ebf8f03a399a343088fa46e4ee13cb.tar.gz
fixes #14112, tests for #12892, #12671, #11697 (#14125)
Diffstat (limited to 'tests')
-rw-r--r--tests/js/t11697.nim5
-rw-r--r--tests/js/temptyseq.nim8
-rw-r--r--tests/stdlib/tunidecode.nim2
-rw-r--r--tests/tuples/t12892.nim8
4 files changed, 23 insertions, 0 deletions
diff --git a/tests/js/t11697.nim b/tests/js/t11697.nim
new file mode 100644
index 000000000..967752586
--- /dev/null
+++ b/tests/js/t11697.nim
@@ -0,0 +1,5 @@
+import tables
+
+var xs: Table[int, Table[int, int]]
+
+doAssertRaises(KeyError): reset xs[0]
diff --git a/tests/js/temptyseq.nim b/tests/js/temptyseq.nim
new file mode 100644
index 000000000..df4b3e8da
--- /dev/null
+++ b/tests/js/temptyseq.nim
@@ -0,0 +1,8 @@
+# #12671
+
+proc foo =
+  var x: seq[int]
+  doAssertRaises(IndexError):
+    inc x[0]
+
+foo()
diff --git a/tests/stdlib/tunidecode.nim b/tests/stdlib/tunidecode.nim
index 689453c76..576bfa2cb 100644
--- a/tests/stdlib/tunidecode.nim
+++ b/tests/stdlib/tunidecode.nim
@@ -5,6 +5,8 @@ discard """
 
 import unidecode
 
+import std/unidecode # #14112
+
 loadUnidecodeTable("lib/pure/unidecode/unidecode.dat")
 
 #assert unidecode("\x53\x17\x4E\xB0") == "Bei Jing"
diff --git a/tests/tuples/t12892.nim b/tests/tuples/t12892.nim
new file mode 100644
index 000000000..d69e99c7f
--- /dev/null
+++ b/tests/tuples/t12892.nim
@@ -0,0 +1,8 @@
+discard """
+  disabled: i386
+"""
+
+template works[T](): auto = T.high - 1
+template breaks[T](): auto = (T.high - 1, true)
+doAssert $works[uint]() == "18446744073709551614"
+doAssert $breaks[uint]() == "(18446744073709551614, true)"