summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorflywind <43030857+xflywind@users.noreply.github.com>2020-12-27 02:16:53 -0600
committerGitHub <noreply@github.com>2020-12-27 09:16:53 +0100
commit1d615dfda7102c5d7f190b077c0ae87abac34228 (patch)
tree5f1870685189e77d9c36b85c910af01fd78ca06f /tests
parent1e859fa320e6f6a0fa3773c1ecf37707dd656b6c (diff)
downloadNim-1d615dfda7102c5d7f190b077c0ae87abac34228.tar.gz
fix #16474 `unittest.check type1 is type2` gives CT error (#16476)
* fix #16474
* more tests
Diffstat (limited to 'tests')
-rw-r--r--tests/stdlib/tunittestpass.nim19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/stdlib/tunittestpass.nim b/tests/stdlib/tunittestpass.nim
new file mode 100644
index 000000000..cff37a3b7
--- /dev/null
+++ b/tests/stdlib/tunittestpass.nim
@@ -0,0 +1,19 @@
+discard """
+  targets: "c js"
+"""
+
+
+import unittest
+
+block:
+  check (type(1.0)) is float
+  check type(1.0) is float
+  check (typeof(1)) isnot float
+  check typeof(1) isnot float
+
+  check 1.0 is float
+  check 1 isnot float
+
+  type T = type(0.1)
+  check T is float
+  check T isnot int