summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorGrzegorz Adam Hankiewicz <gradha@imap.cc>2013-06-16 13:42:36 +0200
committerGrzegorz Adam Hankiewicz <gradha@imap.cc>2013-06-16 22:39:38 +0200
commit25f45cace14f9b48f4b7ada3ace4c4f430d703a6 (patch)
tree55c2a9888d071a9d24187ed8396d4f1d930f8d0a /tests
parentb15f585273092f05145dd5b3fec5e83e27fbe45a (diff)
downloadNim-25f45cace14f9b48f4b7ada3ace4c4f430d703a6.tar.gz
Adds idetools test to check declaration proc signatures.
Diffstat (limited to 'tests')
-rw-r--r--tests/caas/forward_declarations.nim15
-rw-r--r--tests/caas/forward_declarations.txt9
2 files changed, 24 insertions, 0 deletions
diff --git a/tests/caas/forward_declarations.nim b/tests/caas/forward_declarations.nim
new file mode 100644
index 000000000..177d82f20
--- /dev/null
+++ b/tests/caas/forward_declarations.nim
@@ -0,0 +1,15 @@
+# This example shows that idetools returns an empty signature for a forward
+# declared proc in proc/symproc runs, but correctly returns the full signature
+# in caas mode.
+
+proc echoHello(text: string)
+
+proc testForward() =
+  echo "T"
+  echoHello("T")
+
+proc echoHello(text: string) =
+  echo "Hello Mr." & text
+
+when isMainModule:
+  testForward()
diff --git a/tests/caas/forward_declarations.txt b/tests/caas/forward_declarations.txt
new file mode 100644
index 000000000..b1695b9c7
--- /dev/null
+++ b/tests/caas/forward_declarations.txt
@@ -0,0 +1,9 @@
+forward_declarations.nim
+
+> idetools --track:$TESTNIM,9,5 --def $SILENT
+skProc
+proc \(string\)
+
+> idetools --track:$TESTNIM,5,9 --def $SILENT
+skProc
+proc \(string\)