summary refs log tree commit diff stats
path: root/tests/navigator
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2021-04-19 22:37:09 +0200
committerGitHub <noreply@github.com>2021-04-19 22:37:09 +0200
commit3b80f0dc8ef2bc9d2a981a7c92a6355dfc72b7ef (patch)
tree343dfdc727acde6e8e349661a94c208d1ceda9c0 /tests/navigator
parent24abe10aa8cdf3daa69854bba403ad4cee527503 (diff)
downloadNim-3b80f0dc8ef2bc9d2a981a7c92a6355dfc72b7ef.tar.gz
IC navigator: added support for include files (#17784)
* ic fixed navigator crash when track wrong/missed

Also fixed an issue with getNimcacheDir not observing the outDir.

* closer, but not sure how to test[skip ci][ci skip]

* IC navigator: added support for include files

* update

* make posix happy via expandFilename

* update

Co-authored-by: Saem Ghani <saemghani+github@gmail.com>
Diffstat (limited to 'tests/navigator')
-rw-r--r--tests/navigator/minclude.nim2
-rw-r--r--tests/navigator/tincludefile.nim29
-rw-r--r--tests/navigator/tnav1.nim4
3 files changed, 33 insertions, 2 deletions
diff --git a/tests/navigator/minclude.nim b/tests/navigator/minclude.nim
new file mode 100644
index 000000000..f65ebfab9
--- /dev/null
+++ b/tests/navigator/minclude.nim
@@ -0,0 +1,2 @@
+# An include file.
+foo(3)
diff --git a/tests/navigator/tincludefile.nim b/tests/navigator/tincludefile.nim
new file mode 100644
index 000000000..f35ab2ec9
--- /dev/null
+++ b/tests/navigator/tincludefile.nim
@@ -0,0 +1,29 @@
+discard """
+  cmd: "nim check $options --defusages:$file,12,7 $file"
+  nimout: '''def tincludefile_temp.nim(11, 10)
+usage tincludefile_temp.nim(12, 8)
+  '''
+"""
+
+
+
+
+proc foo(x: int) =
+  echo x
+
+foo(3)
+echo "yes", 1 != 3
+
+#!EDIT!#
+discard """
+  cmd: "nim check $options --defusages:$file/../minclude.nim,2,2 $file"
+  nimout: '''def tincludefile_temp.nim(10, 6)
+usage minclude.nim(2, 1)
+  '''
+"""
+
+
+proc foo(x: int) =
+  echo x
+
+include minclude
diff --git a/tests/navigator/tnav1.nim b/tests/navigator/tnav1.nim
index d7c6f63e2..b6bbdbf19 100644
--- a/tests/navigator/tnav1.nim
+++ b/tests/navigator/tnav1.nim
@@ -1,5 +1,5 @@
 discard """
-  cmd: "nim check $options --track:$file,12,7 $file"
+  cmd: "nim check $options --defusages:$file,12,7 $file"
   nimout: '''def tnav1_temp.nim(11, 10)
 usage tnav1_temp.nim(12, 8)
   '''
@@ -16,7 +16,7 @@ echo "yes", 1 != 3
 
 #!EDIT!#
 discard """
-  cmd: "nim check $options --track:$file,15,2 $file"
+  cmd: "nim check $options --defusages:$file,15,2 $file"
   nimout: '''def tnav1_temp.nim(12, 6)
 usage tnav1_temp.nim(15, 1)
   '''